Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
where is wrong?#include<stdio.h> main() { int s[20],t[20]; int dis=0,num=0,i=1; t[0]=0; scanf ("%d",&num); while(num!=-1); { for(;i<=num;) { scanf("%d%d",&s[i],&t[i]); i++; } for(;i>=1;) {dis+=s[i]*(t[i]-t[i-1]); i--;} printf ("%d miles",dis); scanf("%d",&num); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator