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

Re:help!!!!!

Posted by lyp at 2008-12-29 22:14:28 on Problem 1552
In Reply To:help!!!!! Posted by:00448152 at 2005-03-17 14:07:25
> #include<iostream.h>
> void main()
> {
> 	int i,j,a[15];
> 	int num=0,n=0;
> 	for(i=0;i<15;i++)
> 	{
> 		cin>>a[i];
> 		if(a[i]==0||a[i]==-1)
> 			break;
> 		n++;
> 	}
> 	while(a[0]!=-1)
> 	{
> 		
> 	for(i=0;i<n;i++)
> 	{
> 		for(j=i+1;j<n;j++)
> 		{
> 			if((a[i]==2*a[j])||(2*a[i]==a[j]))
> 				num++;
> 		}
> 	}
> 		cout<<num<<endl;
> 	num=0;
> 	n=0;
> 	for(i=0;i<15;i++)
> 	{
> 		cin>>a[i];
> 		if(a[i]==0||a[i]==-1)
> 			break;
> 		n++;
> 	}
> 	}
> }
> 
> 
> 
> 
> 
> 	好像只能测试一组数据,你再试试

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