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:哪位大哥看一下,为什么老compile error

Posted by 618907 at 2010-05-08 17:03:59 on Problem 2196
In Reply To:哪位大哥看一下,为什么老compile error Posted by:618907 at 2010-05-08 17:00:11
> #include<iostream>
> using namespace std;
> int sum(int n,int i)
> 
> 	{
> 	int m,s=0;
> 	while(n>0)
> 		{
> 		m=n%i;
> 		n=n/i;
> 		s+=m;
> 		}
> 	return s;
> 	}
> 
> 
> void main()
> 	{
> 	int i,t;
> 	for(i=2992;i<10000;i++)
> 		{
> 		t=sum(i,10);
> 		if(t==sum(i,12)&&t==sum(i,16))
> 			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