Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define pub push_back
- string s[10];
- int cnt=0;
- void init (){
- queue < string > q;
- q.push("1");
- cnt ++ ;
- while ( cnt != 10 ){
- string get= q.front();
- q.pop();
- s[cnt] = get ;
- cout<<get<<" ";
- string first = get+"0";
- string second = get +"1";
- q.push(first);
- q.push(second);
- cnt++;
- }
- }
- int main(){
- init ();
- return 0;
- }
Add Comment
Please, Sign In to add comment