foo.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
include<stdio.h>
^
foo.c: In function 'zhao':
foo.c:6:24: error: 'a' undeclared (first use in this function)
int i=l,j=n,mid,t; mid=a[(l+n)/2]; while(i<=j) { while(a[i]<mid) i++; while(a[j]>mid) j--; if(i<=j) { t=a[i]; a[i]=a[j]; a[j]=t; i++; j--; } } if(l<j) zhao(l,j); if(i<n) zhao(i,n); }
^
foo.c:6:24: note: each undeclared identifier is reported only once for each function it appears in
foo.c: In function 'jue':
foo.c:9:14: error: 'a' undeclared (first use in this function)
int sum; sum=a[i]-a[j]; if(sum<0) sum=-sum; return sum; }
^
foo.c: In function 'main':
foo.c:12:1: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
int n,i,x,p,j; scanf("%d",&n); for(i=1;i<=n;i++) scanf("%d %d",&x,&a[i]); zhao(1,n); for(i=1;i<=n;i++) { if(a[i]!=a[i-1]) for(j=1;j<=n;j++) { b[i]=b[i]+jue(j,i); } } p=b[1]; for(i=1;i<=n;i++) { if(a[i]!=a[i-1]) if(p>b[i]) p=b[i]; } printf("%d",p); return 0; }
^
foo.c:12:16: warning: incompatible implicit declaration of built-in function 'scanf'
int n,i,x,p,j; scanf("%d",&n); for(i=1;i<=n;i++) scanf("%d %d",&x,&a[i]); zhao(1,n); for(i=1;i<=n;i++) { if(a[i]!=a[i-1]) for(j=1;j<=n;j++) { b[i]=b[i]+jue(j,i); } } p=b[1]; for(i=1;i<=n;i++) { if(a[i]!=a[i-1]) if(p>b[i]) p=b[i]; } printf("%d",p); return 0; }
^
foo.c:12:68: error: 'a' undeclared (first use in this function)
int n,i,x,p,j; scanf("%d",&n); for(i=1;i<=n;i++) scanf("%d %d",&x,&a[i]); zhao(1,n); for(i=1;i<=n;i++) { if(a[i]!=a[i-1]) for(j=1;j<=n;j++) { b[i]=b[i]+jue(j,i); } } p=b[1]; for(i=1;i<=n;i++) { if(a[i]!=a[i-1]) if(p>b[i]) p=b[i]; } printf("%d",p); return 0; }
^
foo.c:12:143: error: 'b' undeclared (first use in this function)
int n,i,x,p,j; scanf("%d",&n); for(i=1;i<=n;i++) scanf("%d %d",&x,&a[i]); zhao(1,n); for(i=1;i<=n;i++) { if(a[i]!=a[i-1]) for(j=1;j<=n;j++) { b[i]=b[i]+jue(j,i); } } p=b[1]; for(i=1;i<=n;i++) { if(a[i]!=a[i-1]) if(p>b[i]) p=b[i]; } printf("%d",p); return 0; }
^
foo.c:12:1: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
int n,i,x,p,j; scanf("%d",&n); for(i=1;i<=n;i++) scanf("%d %d",&x,&a[i]); zhao(1,n); for(i=1;i<=n;i++) { if(a[i]!=a[i-1]) for(j=1;j<=n;j++) { b[i]=b[i]+jue(j,i); } } p=b[1]; for(i=1;i<=n;i++) { if(a[i]!=a[i-1]) if(p>b[i]) p=b[i]; } printf("%d",p); return 0; }
^
foo.c:12:233: warning: incompatible implicit declaration of built-in function 'printf'
int n,i,x,p,j; scanf("%d",&n); for(i=1;i<=n;i++) scanf("%d %d",&x,&a[i]); zhao(1,n); for(i=1;i<=n;i++) { if(a[i]!=a[i-1]) for(j=1;j<=n;j++) { b[i]=b[i]+jue(j,i); } } p=b[1]; for(i=1;i<=n;i++) { if(a[i]!=a[i-1]) if(p>b[i]) p=b[i]; } printf("%d",p); return 0; }
^