>> Delete No. 13290 article
No. C소스인데 왜안되는지....

등록 2000-12-03 01:16:00 By localhost     조회 2
이름 날업    

		<pre>
지난번 기능사시험문제 보고 푼건데 뭐가 잘못되었는데 안돼네여.
시간 나시는분 좀 봐주세요....저 내일 셤봄니다...T.T
 #include<stdio.h>
#include<string.h>
#include<conio.h>
  struct rec1
 {
  int num;
  char code[2];
  int grade;
  int mpay;
 }chart;
  struct rec2
 {
  int num;
  char code[8];
  int ypay;
  int ypay2;
  float rate;
  char bonus;
 }list[9];
  void print1();
 void input();
 void give();
 void print2();
 void output();
  int count;
 char bcode[6][2]={"A","B","C","D","E","F"};
 char bname[6][7]={"junsan","upmu","insa","kwanri","jajae","hongbo"};
 float rate[6]={0.9,1.4,1.5,1.3,1.2,1.1};
  void main()
 {
  int select;
   while(select!=3){
  clrscr();
  print1();
  scanf("%d",&select);
   switch(select)
  {
   case 1 : input();
	    give();
	    count++;
	    break;
    case 2 :
	    clrscr();
	    print2();
	    output();
	    getch();
	    break;
   }
  }
 }
 void print1()
 {
  gotoxy(10,8);
  printf("sawon number:");
  gotoxy(10,10);
  printf("buseo code:");
  gotoxy(10,12);
  printf("grade:");
  gotoxy(10,14);
  printf("average pay:");
  gotoxy(12,16);
  printf("enter input(1) or output(2) or out(3):");
 }
  void input()
 {
  gotoxy(23,8);
  scanf("%d",&chart.num);
  gotoxy(21,10);
  scanf("%s",&chart.code);
  gotoxy(17,12);
  scanf("%d",&chart.grade);
  gotoxy(23,14);
  scanf("%d",&chart.mpay);
 }
 void give()
 {
  int i;
   list[count].num = chart.num;
   for(i=0;i<6;i++)
   if(strcmp(chart.code,bcode[i])==0)break;
    strcpy(list[count].code,bname[i]);
   list[count].ypay = 12 * chart.mpay;
   list[count].rate = rate[i];
   list[count].ypay2 = list[count].rate * list[count].ypay;
   if(chart.grade>=60) list[count].bonus='O';
  else list[count].bonus='X';
  }
   void print2()
  {
   gotoxy(10,8);
   printf("snumber");
   gotoxy(20,8);
   printf("bname");
   gotoxy(30,8);
   printf("stipend");
   gotoxy(40,8);
   printf("nstipend");
   gotoxy(50,8);
   printf("rate");
   gotoxy(60,8);
   printf("bonus");
  }
  void output()
 {
  int i;
   for(i=0;i<count;i++)
    printf("	%d	%s	%d	%f	%f	%c",list[count].num,list[count].code,list[count].ypay,list[count].ypay2,list[count].rate,li
st[count].bonus);  }
[관리자] 패스워드를 입력 하십시오. 답장이 존재하면 함께 삭제됩니다.[ 목록 | 이전 ]
패스워드:    

Copyleft 1999-2026 by JSBoard Open Project
Theme Designed by IDOO All right reserved