原题:http://acm.hdu.edu.cn/showproblem.php?pid=2097
#include <iostream>
using namespace std;
int main()
{
int n;
int a,b,c;
int tmp;
while(cin>>n && n)
{
a=b=c=0;
int m=n;
while(m)
{
a+=m%10;
m/=10;
}
m=n;
while(m)
{
tmp=m%12;
//cout<<m%12<<' ';
b+=tmp;
m=(m-tmp)/12;
}
//cout<<endl;
m=n;
while(m)
{
tmp=m%16;
//cout<<m%16<<' ';
c+=tmp;
m=(m-tmp)/16;
}
cout<<n<<' ';
if(a==b && b==c)
{
cout<<"is ";
}
else
{
cout<<"is not ";
}
cout<<"a Sky Number."<<endl;
}
return 0;
}