foo.c: In function 'main':
foo.c:6:29: warning: unused variable 'flag' [-Wunused-variable]
int i,n,w,a[30000],j,num=0,flag=0;
^~~~
foo.c:7:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&w);
^~~~~~~~~~~~~~
foo.c:8:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&n);
^~~~~~~~~~~~~~
foo.c:11:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&a[i]);//a[i]里是价格
^~~~~~~~~~~~~~~~~