Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

老实翻译的怎么会WA?help

Posted by OSJake at 2009-06-17 13:17:58 on Problem 1552
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator