Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <cmath>
- #include <vector>
- #include <algorithm>
- using namespace std ;
- ifstream cin ("input") ;ofstream cout ("output") ;
- vector < string > v;
- vector < string > aux;
- int main()
- {
- int n;
- cin>>n;
- v.push_back("0");
- v.push_back("1");
- for (int i=1; i<n; i++){
- aux = v;
- reverse(aux.begin() , aux.end());
- for (auto &x : v){
- x += "0";
- }
- for (auto &x : aux){
- v.push_back(x + "1");
- }
- }
- for (auto &x : v){
- cout<<x<<'\n';
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement