Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 15870 Accepted Submission(s):
9157
#include<stdio.h>
int main()
{
int shi,er,liu,n,a;
while(scanf("%d",&shi)!=EOF&&shi!=0)
{
er=0;liu=0;n=0;a=0;
n=shi;
while(shi!=0)
{
a+=shi%10;
shi=shi/10;
}
shi=n;
while(shi!=0)
{
er+=shi%12;
shi=shi/12;
}
shi=n;
while(shi!=0)
{
liu+=shi%16;
shi=shi/16;
}
shi=n;
if(er==liu&&liu==a)
printf("%d is a Sky Number.\n",shi);
else
printf("%d is not a Sky Number.\n",shi);
}
return 0;
}
原文:http://www.cnblogs.com/tonghao/p/4368511.html