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:两个比较 WA 和AC的

Posted by jacklb at 2009-04-12 15:26:16 on Problem 2196
In Reply To:两个比较 WA 和AC的 Posted by:19871026 at 2009-03-24 01:04:41
#include<iostream>
using namespace std;
int main()
{
	int a,b,c,sum,sum1,sum2;
	for(int i=2992;i<10000;i++)
	{
		a=i;b=i;c=i;
		sum=sum1=sum2=0;
		while(a>0)
		{
			sum+=a%10;
			a/=10;
		}
		while(b>0)
		{
			sum1+=b%12;
			b/=12;
		}
		while(c>0)
		{
			sum2+=c%16;
			c/=16;
		}
		if(sum==sum1&&sum1==sum2)
			cout<<i<<endl;

	}
	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