0_0_16259806_12373.c:9:1: error: unknown type name 'pm'
pm p[111];
^
0_0_16259806_12373.c: In function 'cmp':
0_0_16259806_12373.c:12:11: error: 'pm' undeclared (first use in this function)
if((*(pm *)a).l-(*(pm *)a).r!= (*(pm *)b).l-(*(pm *)b).r)
^
0_0_16259806_12373.c:12:11: note: each undeclared identifier is reported only once for each function it appears in
0_0_16259806_12373.c:12:15: error: expected expression before ')' token
if((*(pm *)a).l-(*(pm *)a).r!= (*(pm *)b).l-(*(pm *)b).r)
^
0_0_16259806_12373.c:12:28: error: expected expression before ')' token
if((*(pm *)a).l-(*(pm *)a).r!= (*(pm *)b).l-(*(pm *)b).r)
^
0_0_16259806_12373.c:12:43: error: expected expression before ')' token
if((*(pm *)a).l-(*(pm *)a).r!= (*(pm *)b).l-(*(pm *)b).r)
^
0_0_16259806_12373.c:12:56: error: expected expression before ')' token
if((*(pm *)a).l-(*(pm *)a).r!= (*(pm *)b).l-(*(pm *)b).r)
^
0_0_16259806_12373.c:14:23: error: expected expression before ')' token
return (*(pm *)a).l-(*(pm *)a).r<(*(pm *)b).l-(*(pm *)b).r;
^
0_0_16259806_12373.c:14:36: error: expected expression before ')' token
return (*(pm *)a).l-(*(pm *)a).r<(*(pm *)b).l-(*(pm *)b).r;
^
0_0_16259806_12373.c:14:49: error: expected expression before ')' token
return (*(pm *)a).l-(*(pm *)a).r<(*(pm *)b).l-(*(pm *)b).r;
^
0_0_16259806_12373.c:14:62: error: expected expression before ')' token
return (*(pm *)a).l-(*(pm *)a).r<(*(pm *)b).l-(*(pm *)b).r;
^
0_0_16259806_12373.c:16:15: error: expected expression before ')' token
if((*(pm *)a).r!=(*(pm *)b).r)
^
0_0_16259806_12373.c:16:29: error: expected expression before ')' token
if((*(pm *)a).r!=(*(pm *)b).r)
^
0_0_16259806_12373.c:17:19: error: expected expression before ')' token
return (*(pm *)a).r>(*(pm *)b).r;
^
0_0_16259806_12373.c:17:32: error: expected expression before ')' token
return (*(pm *)a).r>(*(pm *)b).r;
^
0_0_16259806_12373.c:18:19: error: expected expression before ')' token
return (*(pm *)a).n>(*(pm *)b).n;
^
0_0_16259806_12373.c:18:32: error: expected expression before ')' token
return (*(pm *)a).n>(*(pm *)b).n;
^
0_0_16259806_12373.c: In function 'main':
0_0_16259806_12373.c:25:9: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
for(int i=0;i<n;i++)
^
0_0_16259806_12373.c:25:9: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
0_0_16259806_12373.c:27:17: error: request for member 'n' in something not a structure or union
p[i].n=i;
^
0_0_16259806_12373.c:28:31: error: request for member 'l' in something not a structure or union
scanf("%d%d",&p[i].l,&p[i].r);
^
0_0_16259806_12373.c:28:39: error: request for member 'r' in something not a structure or union
scanf("%d%d",&p[i].l,&p[i].r);
^
0_0_16259806_12373.c:30:26: error: 'pm' undeclared (first use in this function)
qsort(p,n,sizeof(pm),cmp);
^
0_0_16259806_12373.c:31:17: error: redefinition of 'i'
for(int i=0;i<n-1;i++)
^
0_0_16259806_12373.c:25:17: note: previous definition of 'i' was here
for(int i=0;i<n;i++)
^
0_0_16259806_12373.c:31:9: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
for(int i=0;i<n-1;i++)
^
0_0_16259806_12373.c:32:30: error: request for member 'n' in something not a structure or union
printf("%d ",p[i].n);
^
0_0_16259806_12373.c:33:29: error: request for member 'n' in something not a structure or union
printf("%d\n",p[n-1].n);
^
|