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 |
AC#include"iostream.h" int main() {int i; int j; int k; int a=0,b=0,c=0; for(i=2992;i<10000;i++) { j=i; k=i; a+=j%10; a+=(j-j%10)/10%10; a+=j/1000; a+=(j-j/1000*1000)/100; b+=j%16; j/=16; b+=j%16; j/=16; b+=j%16; j/=16; b+=j%16; c+=k%12; k/=12; c+=k%12; k/=12; c+=k%12; k/=12; c+=k%12; if(a==b&&b==c) cout<<i<<endl; a=0; b=0; c=0; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator