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:向清华致敬.......同敬...

Posted by scauhito at 2008-12-16 23:51:12
In Reply To:Re:向清华致敬.......同敬... Posted by:winsweet at 2008-12-16 16:25:01
#include<iostream.h>
void main()
{
	while(1)
	{
		int r1[17],r2[17],k,i=1,j=0,count=0;
		cin>>r1[0];
		if(r1[0]==-1)
			break;
		r2[0]=2*r1[0];
		while (cin>>r1[i]&&r1[i]!=0)
		{
			r2[i]=2*r1[i];
			i++;
		}
		k=i;
		for(i=0;i<k;i++)
			for(j=0;j<k;j++)
				if(r2[j]==r1[i])
					count++;
		cout<<count<<endl;
	}
}

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