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 zby03 at 2004-10-17 18:03:54 on Problem 1552
In Reply To:错在何处?请高手指正! Posted by:ibm at 2004-04-25 20:34:20
这里有一个解:
#include<iostream.h>

int main()
{
	int arr[16];
	cin>>arr[0];
	while(arr[0]!=-1)
	{
		int count=0;
		int ind=1;
		cin>>arr[ind];
		while(arr[ind]!=0)
		{
			ind++;
			cin>>arr[ind];
		}
		for(int i=0;i<ind;i++)
		{
			for(int j=0;j<ind;j++)
			{
				if(arr[i]==2*arr[j])
					count++;
			}
		}
		cout<<count<<endl;
		cin>>arr[0];
	}
	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