foo.c: In function 'main':
foo.c:19:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d",&n,&m);
^~~~~~~~~~~~~~~~~~~
foo.c:21:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&v[i]);
^~~~~~~~~~~~~~~~~
foo.c:24:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&plus);
^~~~~~~~~~~~~~~~~
foo.c:26:4: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&cost[j]);
^~~~~~~~~~~~~~~~~~~~