1 #include <stdio.h>
2
3 int sum(int number,int p);
4
5 int main(){
6 int n;
7 int sum_10;
8 int sum_12;
9 int sum_16;
10
11 while(1){
12 scanf("%d",&n);
13
14 if(n==0)
15 break;
16
17 sum_10=sum(n,10);
18 sum_12=sum(n,12);
19 sum_16=sum(n,16);
20
21 if(sum_10==sum_12 && sum_10==sum_16)
22 printf("%d is a Sky Number.
",n);
23
24 else
25 printf("%d is not a Sky Number.
",n);
26 }
27 return 0;
28 }
29
30 int sum(int number,int p){
31 int result;
32
33 result=0;
34 while(number){
35 result+=number%p;
36 number/=p;
37 }
38
39 return result;
40 }