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 |
好吧,我很可耻地用了stl#include <iostream> #include <bitset> #include <algorithm> #include <string> using namespace std; unsigned long i,t; string str; int main() { while(cin>>i&&i) { bitset<8*sizeof(unsigned long)> j(i); str=j.to_string(); next_permutation(str.begin(),str.end()); bitset<8*sizeof(unsigned long)> k(str); t=k.to_ulong(); cout << t << 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