At the time it felt like a problem that deserved its own separate solution. I remember agonizing for ages over how hexadecimal numbers should be represented… Only later did I realize I was overthinking it -.-.
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include<stdio.h>
intmain(){intn,i,a,b,c;while(scanf("%d",&n),n!=0){a=n%10+n/10%10+n/100%10+n/1000;for(i=n,b=0;i!=0;i=i/12)b=b+i%12;for(i=n,c=0;i!=0;i=i/16)c=c+i%16;if(a==b&&a==c)printf("%d is a Sky Number.\n",n);elseprintf("%d is not a Sky Number.\n",n);}return0;}