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 |
Re:两个比较 WA 和AC的In Reply To:两个比较 WA 和AC的 Posted by:19871026 at 2009-03-24 01:04:41 #include<iostream> using namespace std; int main() { int a,b,c,sum,sum1,sum2; for(int i=2992;i<10000;i++) { a=i;b=i;c=i; sum=sum1=sum2=0; while(a>0) { sum+=a%10; a/=10; } while(b>0) { sum1+=b%12; b/=12; } while(c>0) { sum2+=c%16; c/=16; } if(sum==sum1&&sum1==sum2) cout<<i<<endl; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator