Compile Error.
/tmp/voj-1463/TFVwVOpZpfku.c: In function ‘main’:
/tmp/voj-1463/TFVwVOpZpfku.c:30:29: error: stray ‘\342’ in program
30 | if(stu[i].qi>85&&stu[i].xi==‘Y’)
| ^
/tmp/voj-1463/TFVwVOpZpfku.c:30:30: error: stray ‘\200’ in program
30 | if(stu[i].qi>85&&stu[i].xi==‘Y’)
| ^
/tmp/voj-1463/TFVwVOpZpfku.c:30:31: error: stray ‘\230’ in program
30 | if(stu[i].qi>85&&stu[i].xi==‘Y’)
| ^
/tmp/voj-1463/TFVwVOpZpfku.c:30:33: error: stray ‘\342’ in program
30 | if(stu[i].qi>85&&stu[i].xi==‘Y’)
| ^
/tmp/voj-1463/TFVwVOpZpfku.c:30:34: error: stray ‘\200’ in program
30 | if(stu[i].qi>85&&stu[i].xi==‘Y’)
| ^
/tmp/voj-1463/TFVwVOpZpfku.c:30:35: error: stray ‘\231’ in program
30 | if(stu[i].qi>85&&stu[i].xi==‘Y’)
| ^
/tmp/voj-1463/TFVwVOpZpfku.c:30:32: error: ‘Y’ undeclared (first use in this function)
30 | if(stu[i].qi>85&&stu[i].xi==‘Y’)
| ^
/tmp/voj-1463/TFVwVOpZpfku.c:30:32: note: each undeclared identifier is reported only once for each function it appears in
/tmp/voj-1463/TFVwVOpZpfku.c:32:31: error: stray ‘\342’ in program
32 | if(stu[i].ban>80&&stu[i].xue==‘Y’)
| ^
/tmp/voj-1463/TFVwVOpZpfku.c:32:32: error: stray ‘\200’ in program
32 | if(stu[i].ban>80&&stu[i].xue==‘Y’)
| ^
/tmp/voj-1463/TFVwVOpZpfku.c:32:33: error: stray ‘\230’ in program
32 | if(stu[i].ban>80&&stu[i].xue==‘Y’)
| ^
/tmp/voj-1463/TFVwVOpZpfku.c:32:35: error: stray ‘\342’ in program
32 | if(stu[i].ban>80&&stu[i].xue==‘Y’)
| ^
/tmp/voj-1463/TFVwVOpZpfku.c:32:36: error: stray ‘\200’ in program
32 | if(stu[i].ban>80&&stu[i].xue==‘Y’)
| ^
/tmp/voj-1463/TFVwVOpZpfku.c:32:37: error: stray ‘\231’ in program
32 | if(stu[i].ban>80&&stu[i].xue==‘Y’)
| ^
Compile Error, Time = 0 ms, Memory = 0 KB, Score = 0.
#include <stdio.h>
#include <stdlib.h>
typedef struct
{
char name[20];
int qi;
int ban;
char xue;
char xi;
int lun;
} student;
int main()
{
student stu[100];
int n,sum2=0,max;
int sum[100]={0},sum1[100]={0};
scanf("%d",&n);
int i,j,t;
for(i=0; i<n; i++)
scanf("%s %d %d %c %c %d",stu[i].name,&stu[i].qi,&stu[i].ban,&stu[i].xue,&stu[i].xi,&stu[i].lun);
for(i=0; i<n; i++)
{
if(stu[i].qi>80&&stu[i].lun>=1)
sum[i]+=8000;
if(stu[i].qi>85&&stu[i].ban>80)
sum[i]+=4000;
if(stu[i].qi>90)
sum[i]+=2000;
if(stu[i].qi>85&&stu[i].xi==‘Y’)
sum[i]+=1000;
if(stu[i].ban>80&&stu[i].xue==‘Y’)
sum[i]+=850;
}
for(i=0; i<n; i++)
sum1[i]=sum[i];
for(i=0; i<n; i++)
for(j=0; j<n-i-1; j++)
{
if(sum1[j]>sum1[j+1])
{
t=sum1[j];
sum1[j]=sum1[j+1];
sum1[j+1]=t;
}
}
for(i=0; i<n; i++)
{
sum2+=sum[i];
}
for(i=0; i<n; i++)
{
if(sum[i]==sum1[n-1])
{
max=i;
break;
}
}
printf("%s\n%d\n%d",stu[max].name,sum[max],sum2);
return 0;
}
length 905 B