#include<iostream>
using namespace std;
int text(int n,int hex)
{
int sum=0;
while(n)
{
sum+=n%hex;
n/=hex;
}
return sum;
}
int main()
{
int n;
while(cin>>n&&n)
{
if((text(n,10)==text(n,12))&&(text(n,12)==text(n,16)))
cout<<n<<" is a Sky Number."<<endl;
else cout<<n<<" is not a Sky Number."<<endl;
}
return 0;
}
hdu 2097 Sky数
最新推荐文章于 2021-05-18 22:42:40 发布