此题也是一道简单的应用题,也没有什么太多难的!!!
废话不多说,直接ac了!!!哈哈哈!!!
**注关于进制转换请参考杭电2031!!!
#include<iostream>
using namespace std;int main(){ int n; while(cin>>n&&n!=0) { int a=n/1000+n/100%10+n/10%10+n%10; int i=n,j=n;; int b=0,c=0; while(i>0) { b+=i%16; i=i/16; } while(j>0) {c+=j%12; j=j/12; } if(a==b&&b==c) cout<<n<<" is a Sky Number."<<endl; else cout<<n<<" is not a Sky Number."<<endl; } return 0;}