c++ 왜 에러가 낫는지 알려주세요ㅠㅠ
가을바람
#includestdio.h
struct sungjuk {
char *name;
int korean;
int english;
int math;
int science;
int sum;
int glade;
};
int max4(int test[1].sum, int test[2].sum, int test[3].sum, int test[4].sum)
{
int max= int test[1].sum;
if(test[2].summax) max=test[2].sum;
if(test[3].summax) max=test[3].sum;
if(test[4].summax) max=test[4].sum;
return(max);
void main()
{
struct sungjuk test[4]={
{김창렬,95,78,85,96},
{리지,96,80,,96,80,77,88},
{선미,100,88,91,76},
{손동운,84,98,90,86}
};
int i,j;
int count =1 ;
for(i=0; i4; i++)
test[i].sum= test[i].korean+test[i].english+test[i].math+test[i].science;
for(i=0; i4; i++,count=1)
{
for(j=0; j4;j++)
{
if(test[i].sum test[j].sum)
count ++;
}
test[i].glade=count;
printf(%6s %3d %3d %3d %3d %4d %d \n,
test[i].name, test[i].korean, test[i].english, test[i].math, test[i].science , test[i].sum, test[i].glade );
}
printf(가장 시험을 잘 본 점수는 %d입니다.\n, max(test[1].sum, test[2].sum, test[3].sum, test[4].sum));
}에러가 안낫엇는데
max함수를 쓰자 에러가 나요ㅠㅠㅠ
왜그럴까요?
알려주세요!!
-
DevilsTears
저;; MAX 함수 괄호가 안닫혔는데요;;;;;;