| ||||||||||
| 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 | |||||||||
那位大牛帮帮忙,告诉我为什么G++可以AC,而C++就 Runtime Error,怪异呀............//2835169 bjss 1426 Accepted 3552K 31MS G++ 227B 2007-10-26 17:27:09
//2835180 bjss 1426 Runtime Error C++ 226B 2007-10-26 17:30:18
/*不知道为什么G++可以AC,而C++就 Runtime Error*/
#include<iostream.h>
int a[524300],i,n;
int main(){
while(cin>>n){
i=1; a[1]=1%n;
while(a[i]){i++; a[i]=(a[i/2]*10+i%2)%n;}
n=0; while(i){a[n++]=i%2;i>>=1;}
while(n--) cout<<a[n]; cout<<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