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

AC

Posted by benny2008 at 2007-11-30 14:23:50 on Problem 2196
#include"iostream.h"
int main()
{int i;
 int j;
 int k;
 int a=0,b=0,c=0;
 for(i=2992;i<10000;i++)
 {
	 j=i;
	 k=i;
	 a+=j%10;
	 a+=(j-j%10)/10%10;
	 a+=j/1000;
	 a+=(j-j/1000*1000)/100;
     b+=j%16;
	 j/=16;
	 b+=j%16;
	 j/=16;
	 b+=j%16;
	 j/=16;
	 b+=j%16;
	 c+=k%12;
	 k/=12;
	 c+=k%12;
	 k/=12;
	 c+=k%12;
	 k/=12;
	 c+=k%12;
	 if(a==b&&b==c) cout<<i<<endl;
	 a=0;
	 b=0;
	 c=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