0_0_20345243_3134.c:11:2: error: unknown type name 'Food'
Food a[1005];
^
0_0_20345243_3134.c: In function 'cmp':
0_0_20345243_3134.c:15:13: error: 'Food' undeclared (first use in this function)
return (*(Food*)b).temp-(*(Food*)a).temp;
^
0_0_20345243_3134.c:15:13: note: each undeclared identifier is reported only once for each function it appears in
0_0_20345243_3134.c:15:18: error: expected expression before ')' token
return (*(Food*)b).temp-(*(Food*)a).temp;
^
0_0_20345243_3134.c:15:35: error: expected expression before ')' token
return (*(Food*)b).temp-(*(Food*)a).temp;
^
0_0_20345243_3134.c: In function 'main':
0_0_20345243_3134.c:19:2: error: expected expression before '/' token
//freopen("2.txt","r",stdin);
^
0_0_20345243_3134.c:29:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
for(int i=0;i<N;i++)
^
0_0_20345243_3134.c:29:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
0_0_20345243_3134.c:31:24: error: request for member 'j' in something not a structure or union
scanf("%lf%lf",&a[i].j,&a[i].f);
^
0_0_20345243_3134.c:31:32: error: request for member 'f' in something not a structure or union
scanf("%lf%lf",&a[i].j,&a[i].f);
^
0_0_20345243_3134.c:32:8: error: request for member 'temp' in something not a structure or union
a[i].temp=a[i].j/a[i].f;
^
0_0_20345243_3134.c:32:18: error: request for member 'j' in something not a structure or union
a[i].temp=a[i].j/a[i].f;
^
0_0_20345243_3134.c:32:25: error: request for member 'f' in something not a structure or union
a[i].temp=a[i].j/a[i].f;
^
0_0_20345243_3134.c:44:11: error: redefinition of 'i'
for(int i=0;i<N;i++)
^
0_0_20345243_3134.c:29:11: note: previous definition of 'i' was here
for(int i=0;i<N;i++)
^
0_0_20345243_3134.c:44:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
for(int i=0;i<N;i++)
^
0_0_20345243_3134.c:47:14: error: request for member 'f' in something not a structure or union
if(M>a[i].f)
^
0_0_20345243_3134.c:49:15: error: request for member 'j' in something not a structure or union
sum+=a[i].j;
^
0_0_20345243_3134.c:50:13: error: request for member 'f' in something not a structure or union
M-=a[i].f;
^
0_0_20345243_3134.c:54:17: error: request for member 'temp' in something not a structure or union
sum+=M*a[i].temp;
^
|