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:老实翻译的怎么会WA?helpIn Reply To:老实翻译的怎么会WA?help Posted by:OSJake at 2009-06-17 13:17:58 > 输入这样不好!!!把我的给你看以下!AC了的! #include<iostream> using namespace std; int main() { int num,a[20]; while(cin>>(a[0])) {if(a[0]==-1) break; num=0;int i; for(i=1;;i++) {cin>>a[i]; if(a[i]==0) break; } for(int j=0;j<i;j++) for(int k=j+1;k<i;k++) if(a[j]==2*a[k]||a[j]*2==a[k]) num++; cout<<num<<endl; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator