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

各位路过的高手们,找找bug吧《为什么执行不了

Posted by 714170130 at 2010-02-01 14:00:47 on Problem 1552
#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:
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