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