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 sunmoonstar_love at 2005-06-29 11:09:13 on Problem 2196
In Reply To:为什么会WA呢?高手指点啊 Posted by:00 at 2005-06-29 10:45:20
> #include<iostream.h>
> int i,j;
> void main()
> {
> 	for(i=2992;i<10001;i++)
> 	{
> 		int a=0,b=0;
> 		j=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;
> 		if(a==b)
> 			cout<<i<<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