| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
哪位大哥看一下,为什么老compile error#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator