1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | #include<stdio.h> void main() { char name[10];/////////////한 사람 성적 구하기 int score[4];//국,영,수,총 float avg;//평균 printf("Name input: "); scanf("%s",name); printf("Kor Score input: "); scanf("%d",score); printf("Eng Score input: "); scanf("%d",score+1); printf("Mat Score input: "); scanf("%d",score+2); *(score+3)=*score+*(score+1)+*(score+2); avg=*(score+3)/3.f; printf("%s\t%d\t%d\t%d\t%d,\t%f\n",name,*score,*(score+1),*(score+2),*(score+3),avg); } |
'code > C' 카테고리의 다른 글
[C] 성적처리 모듈화-3반 (0) | 2017.04.20 |
---|---|
[C] 성적처리 모듈화-3사람 (0) | 2017.04.20 |
[C] 성적처리 모듈화-1사람 (0) | 2017.04.20 |
[C] 성적처리-3반 (0) | 2017.04.20 |
[C] 성적관리프로그램 - 세 사람 (0) | 2017.04.20 |