#include <iostream>
using namespace std;
int main()
{
int n;
while (cin >> n && n)
{
int Lu = 0, Hui = 0, Yi = 0;
int x = n;
while (x)
{
Lu += x%16;
x = x/16;
}
x = n;
while (x)
{
Hui += x%12;
x = x/12;
}
x = n;
while (x)
{
Yi += x%10;
x = x/10;
}
if (Lu == Yi && Lu == Hui)
cout << n << " is a Sky Number.\n";
else
cout << n << " is not a Sky Number.\n";
}
return 0;
}
HDU ACM 11 2097 Sky数
最新推荐文章于 2020-04-06 11:16:18 发布
