Search found 2 matches

by reza_uranium
Fri Feb 01, 2013 7:40 pm
Forum: Volume 117 (11700-11799)
Topic: 11715 - Car
Replies: 14
Views: 4507

Re: 11715 - Car

Why WA...plz help me :( #include <stdio.h> #include <math.h> int main() { int i,n; double s,a,u,v,t; for(i=1;;i++){ scanf("%d",&n); if(n==0){ break; } if(n==1){ scanf("%lf %lf %lf",&u,&v,&t); s=((u+v)/2.0)*t; a=(v-u)/t; printf("Case %d: %.3lf %.3lf\n",i,s,a); } if(n==2){ scanf("%lf %lf %lf",&u,&v,&a...
by reza_uranium
Fri Feb 01, 2013 4:19 pm
Forum: Volume 103 (10300-10399)
Topic: 10370 - Above Average
Replies: 62
Views: 18498

Re: 10370 - Above Average

getting run time error....how...why :o #include <stdio.h> int main() { int i,j,m,n,a[100],sum,std; double average,percentage; scanf("%d",&n); for(i=1;i<=n;i++){ scanf("%d",&m); sum=0; std=0; for(j=0;j<m;j++){ scanf("%d",&a[j]); sum+=a[j]; } average=sum/m; for(j=0;j<m;j++){ if(average<a[j]){ std++; }...

Go to advanced search