| ||||||||||
| 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 | |||||||||
为什么“哇”了,数据都过了#include<stdio.h>
#define N 100
int main()
{
int a[N]={1},i,j,count=0,n=0;
while(1)
{
count=0;
for(i=0;a[i]!=0;i++)
{
scanf("%d",&a[i+1]);
if(a[1]==-1)
goto end;
}
n=i;
for(i=1;i<n-1;i++)
{
for(j=2;j<n;j++)
{
if(a[j]==2*a[i])
{
count++;
}
}
}
printf("%d\n",count);
}
end:
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator