标签:代码 注意 turn print while mit 比较 而且 ted
传送门:
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 28761 Accepted Submission(s): 16168
#include<bits/stdc++.h> using namespace std; typedef long long ll; int ten(int x) { int sum=0; while(x) { sum+=x%10; x=x/10; } return sum; } int sixth(int x) { int sum=0; while(x) { sum+=x%16; x=x/16; } return sum; } int twelve(int x) { int sum=0; while(x) { sum+=x%12; x=x/12; } return sum; } int main() { int n; while(~scanf("%d",&n)) { if(n==0) break; int a=ten(n); int b=sixth(n); int c=twelve(n); if(a==b&&b==c) { printf("%d is a Sky Number.\n",n); }else { printf("%d is not a Sky Number.\n",n); } } return 0; }
标签:代码 注意 turn print while mit 比较 而且 ted
原文地址:https://www.cnblogs.com/yinbiao/p/9311844.html