Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
此题告诉我们一个道理,数本身是没有进制的#include <stdio.h> int root(int i, int b) { int sum = 0; for(; i > 0; i /= b) sum += i%b; return sum; } int main() { int i; for(i = 2992; i < 10000; i ++) if(root(i, 10) == root(i, 12) && root(i, 12) == root(i, 16)) printf("%d\n", i); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator