Advertisement
reyes-rv9

adn

May 24th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. typedef vector<char> VE;
  6.  
  7. VE v;
  8. int n;
  9.  
  10. void f(int i) {
  11.     if (i == n) {
  12.         for (int j = 0; j < n; ++j) cout << v[j];
  13.         cout << endl;
  14.         return;
  15.     }
  16.    
  17.     v[i] = 'A';
  18.     f(i + 1);
  19.     v[i] = 'C';
  20.     f(i + 1);
  21.     v[i] = 'G';
  22.     f(i + 1);
  23.     v[i] = 'T';
  24.     f(i + 1);
  25. }
  26.  
  27. int main() {
  28.     cin >> n;
  29.     v = VE(n);
  30.     f(0);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement