| ||||||||||
| 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 | |||||||||
请教:为何会Runtime Error?源代码如下:
#include "stdio.h"
void main()
{int a[15],i,j,n,m ;
scanf("%d",&a[0]);
while(a[0]!=-1)
{ i= 1;n=0;
while(a[i-1]!=0)
{scanf("%d",&a[i]);i++;n++;}
m=0;for(i=0;i<n-1;i++)
for(j=i+1;j<n;j++)
if(a[i]==2*a[j]||a[j]==2*a[i]) m++;
printf("%d\n",m);
scanf("%d",&a[0]);
}}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator