성적 출력 하는 프로그램인데요~!!!도움좀 주세욤.ㅠ
하나
제가 국영수 이렇게 점수를 3개씩 입력하는데요
1:
10 20 30
2:
10 20 30
3:
10 20 30
......이렇게 5번 하구용
이 입력 받은 걸로 출력할때 총합이랑 평균 석차 출력 하는 프로그램인데요....에러는 안나는데 소스가 돌아가질 않아욤..ㅠㅠ
머가 잘못됐는지 알려주세욤..ㅠㅠ
#include stdio.h
#define max_stdt 5
#define max_sbjt 3
int main()
{
int i, tot, score[max_stdt][max_sbjt], grade;
float avg;
printf(enter the score...\n);
for (i=0; imax_stdt; i++)
{
printf(%d: \n, i+1);
scanf(%d %d %d, &score[i][0], &score[i][1], &score[i][2]);
}
printf(no kor eng math tot avg grade\n);
for (i=0; imax_stdt; i++)
{
tot = score[i][0] + score[i][1] + score[i][2] + score[i][3];
avg=tot/max_sbjt;
for(i=0; imax_sbjt; i++)
{
score[i][1]=1;
for(grade=0; grademax_sbjt; i++)
{
if(score[i][max_sbjt-2]score[grade][max_sbjt-2])
score[i][max_sbjt-1]++;
}
}
printf(%d : %3d %3d %3d %3d %3.2f %d\n, i, score[i][0], score[i][1], score[i][2], tot, avg, grade);
}
return 0;
}