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 |
Re:我的为什么老是wrong answerIn Reply To:我的为什么老是wrong answer Posted by:2006011415 at 2007-02-28 10:39:44 > #include<iostream> > using namespace std; > int main() > { > int n=0;int a[11][3];int sum=0,d=0; > do{ > cin>>n; > if(n!=-1){ > for(int j=1;j<=n;j++) > { > > cin>>a[j][1] > >>a[j][2]; > > }for(j=2;j<=n;j++) > {d=a[1][1]*a[1][2]; > sum=sum+a[j][1]*(a[j][2]-a[j-1][2]); > } > cout<<sum+d<<" "<<"miles"<<endl; > sum=0; > }}while(n!=-1); > return 0; > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator