Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <map>
  4. #include <vector>
  5.  
  6. using namespace std;
  7.  
  8. struct ltstr
  9. {
  10.   bool operator()(const char* s1, const char* s2) const
  11.   {
  12.     return strcmp(s1, s2) < 0;
  13.   }
  14. };
  15.  
  16. int main( )
  17. {
  18.     map<const char*, int, ltstr> alphabet;
  19.  
  20.     alphabet["A"] = 0;
  21.     alphabet["C"] = 1;
  22.     alphabet["G"] = 2;
  23.     alphabet["T"] = 3;
  24.  
  25.     string seed_word = "TTAA";
  26.  
  27.     vector<vector<double> > pwm;
  28.     for( int i = 0; i < seed_word.length(); i++ )
  29.     {  
  30.         cout << seed_word[i] << alphabet[& seed_word[i]] << "\t";
  31.     }
  32.     cout << endl;
  33.  
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement