Advertisement
jeff69

Untitled

Mar 26th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1.  
  2. #include <iomanip>
  3. #include <iostream>
  4. #include <functional>
  5. #include <algorithm>
  6. #include <math.h>
  7. #include <cmath>
  8. #include <string>
  9. #include <vector>
  10. #include<set>
  11. #include<map>
  12. #include <time.h>
  13. #include <fstream>
  14. using namespace std;
  15. typedef long long ll;
  16.  
  17. typedef double d;
  18. typedef long long ll;
  19. vector <char > v;
  20.  
  21. int l;
  22. void solve(int x){
  23. if (x == l){
  24. for (int i = 0; i < v.size(); i++){
  25. cout << v[i];
  26.  
  27. }cout << endl;
  28.  
  29.  
  30.  
  31. return;
  32. }
  33. v.push_back('0');
  34. solve(x + 1);
  35. v.pop_back();
  36.  
  37. v.push_back('1');
  38. solve(x + 1);
  39. v.pop_back();
  40.  
  41. }
  42. int main()
  43. {
  44. cin >> l;
  45.  
  46.  
  47. solve(0);
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement