#include<cstdio>
#include<iostream>
#include<cstdlib>
using namespace std;
int getx(int n,int x)
{
int ans=0;
while(n>0)
{
ans+=n%x;
n=n/x;
}
return ans;
}
int main()
{
//freopen("jeslie.txt","r",stdin);
int n;
while(cin>>n&&n)
{
int a=getx(n,12);
int b=getx(n,16);
if(a==b)
{
int n_=n;
int c=n_/1000;
n_%=1000;
c+=n_/100;
n_%=100;
c+=n_/10;
n_%=10;
c+=n_;
if(a==c)
cout<<n<<" is a Sky Number."<<endl;
else cout<<n<<" is not a Sky Number."<<endl;
}
else cout<<n<<" is not a Sky Number."<<endl;
}
return 0;
}
hdu----2097
最新推荐文章于 2018-12-16 18:01:34 发布