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 20110706 at 2011-12-16 22:17:28 on Problem 2196
#include<stdio.h>
int sum(int n,int d)
{
	if(n/d)
		return n%d+sum(n/d,d);
	else
		return n;
}
int main()
{
	for(int i=2992;i<=9999;i++)
		if(sum(i,10)==sum(i,12)&&sum(i,10)==sum(i,16))
			printf("%d\n",i);
}

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