| ||||||||||
| 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 | |||||||||
各位路过的高手们,找找bug吧《为什么执行不了#include <stdio.h>
#include <stdlib.h>
int main()
{
int a[15],i=0,j,n=1,m=0;
scanf("%d",&a[0]); //输入第一个
while(a[0]!=-1&&a[0]!=0)//判断第一个是否符合;且可输入多组数
{
while(i<14)//因为第一个数已经定义了
{
scanf("%d",&a[++i]); //符合后输入后续成员
}
for(i=0;i<15;i++)
for(j=i+1;j<15;j++)
if(a[i]==2*a[j]||a[i]==a[j]/2) //判断是否是双倍的
m++;//计数
printf("%d\n",m);
scanf("%d",&a[0]); //输入下一组
}
system("pause");
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator