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 |
老实翻译的怎么会WA?help#include<stdio.h> int main() { int a[20]; int ta[20]; while(true) { int i=0; scanf("%d",&a[i++]); if(a[0]==-1)break; ta[i-1]=a[i-1]*2; while((scanf("%d",&a[i++]))&&(a[i-1]!=0)) ta[i-1]=a[i-1]*2; int count=0; for(int j=0;j<i;j++) for(int k=0;k<i;k++) if(a[j]==ta[k])count++; printf("%d\n",count); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator