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

菜鸟求教,大侠不吝赐教

Posted by wmc at 2009-04-18 01:46:33 and last updated at 2009-04-18 01:47:15
为什么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:
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