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:Help! 不知错哪了In Reply To:Help! 不知错哪了 Posted by:1987 at 2005-03-31 13:34:11 > #include <iostream.h> > void main() > { > int a; > int sum; > int b[16]; > while(1) > { > for(int i=0;i<=15;i++) > { > cin>>a; > if(a==-1) > return; > b[i]=a; > if(a==0) > break; > > } > sum=0; > for(i=0;i<=15;i++) > { > if(b[i]==0) > break; > for(int j=i+1;j<=15;j++) > { > if(b[j]==0) > break; > if(b[i]==b[j]*2||b[i]*2==b[j]) > sum++; > } > } > cout<<sum<<endl; > } > > } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator