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:hi that is the solutionIn Reply To:hi that is the solution Posted by:abdking1987 at 2006-08-13 04:04:28 > #include <iostream> > using namespace std; > void main() > { > int n,k,sum=0,x; > cin>>n; > for(int i=0;i<n;i++) > { > sum=0; > cin>>k; > for(int j=1;j<=k;j++) > { > > cin>>x; > if(k==j) > { > sum+=x; > break; > } > x=x-1; > sum+=x; > > } > cout<<sum<<endl; > } > cin>>n; > } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator