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

등록 2000-12-03 01:16:00     조회 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);  }
이름
암호


>> 관련글
13290 C소스인데 왜안되는지....  날업  2000.12.03  ....
  답장 RE: C소스인데 왜안되는지....  furls  2000.12.03  ....
Register [ localhost 목록보기 윗글 아랫글
글쓰기
답장쓰기 수정 삭제
정규표현식 [ 상세 검색 ]
페이지로딩: [ 0.53 초 ] 작업시간: [ 0.13 초 ]

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

적수네 동네
+
| 적수네 동네
| 공부방
| 리눅스 잡지 서고
| LSN 소스
| 링크 모음
+---+
게시판
+
| 떠들어보세!
| 질문과 답변
| 새소식과 정보
| 1원짜리 팁?
| 대화방
+---+
칼럼?
+
| 세하 훔쳐보기
| Welcome2nite
| 혜진의 염장판
+---+
리눅스 상표권
+
| 반대 서명란
| 토론 게시판
+---+
GNU
+
| GNU 선언문
| GNU GPL
| GNU 미러 목록
+---+
프로젝트?
+
| 리눅스카운터
| RC5DES
| 실질헌법 제작
+---+
커널 소식
+
| 안정 버젼: 2.4.14
+---+
테마 선택
+
LSN 방송국?
+
| OFF AIR
+---+
회원
+
| 로그인
+---+
[ 적수네 동네 ] [ 리눅스 상표권 독점 반대 ] [ 한글 리눅스 문서 프로젝트 ] [ KrLine ] [ 사랑넷 ] [ Valid HTML 4.0! ] [ SlashDot ] [ Freshmeat ]
Copyleft (C) 1998-2001 Byeong-Chan Kim . License
TIME: 1789699987
System by WYZsoft, HDD by I.O.Linux, Mizi Research, Embryo, WOWLINUX, Domain by SarangNet, Network by KrLine.