| ||||||||||
| 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呢???
这段问题出在哪里?
sample都过了
#include<stdio.h>
int main()
{
int a[16],i,j,n,s,t;
while(1)
{
s=0;t=0;
for(n=1;n<=15;n++)
{
scanf("%d",&a[n]);
if(a[n]!=0) t++;
else break;
if(a[n]==-1) exit(0);
}
for(i=1;i<=t;i++)
{
for(j=1;j<=t;j++)
{
if(a[j]==2*a[i]) s++;
}
}
printf("%d\n",s);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator