Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.00 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5.     string s;
  6.     cin >> s;
  7.     bool a = false;
  8.     if (s[0] == 'A' and s[1] == 'U') {
  9.         for (int i = 2; i < s.size(); ++i) {
  10.             if (s[i] == 'A' and s[i+1] == 'A' and (s[i+2] != 'U' or s[i+3] != 'T')) {
  11.                 cout << "Glycine";
  12.                 i++;
  13.                 a = true;
  14.             }
  15.             else if (s[i] == 'A' and s[i+1] == 'T' and (s[i+2] != 'U' or s[i+3] != 'T')) {
  16.                 cout << "Cysteine";
  17.                 i++;
  18.                 a = true;
  19.             }
  20.             else if (s[i] == 'T' and s[i+1] == 'U' and (s[i+2] != 'U' or s[i+3] != 'T')) {
  21.                 cout << "Arginine";
  22.                 i++;
  23.                 a = true;
  24.             }
  25.             else if (s[i] == 'U' and s[i+1] == 'A' and (s[i+2] != 'U' or s[i+3] != 'T')) {
  26.                 cout << "Serine";
  27.                 i++;
  28.                 a = true;
  29.             }
  30.             else if (s[i] == 'U' and s[i+1] == 'U' and (s[i+2] != 'U' or s[i+3] != 'T')) {
  31.                 cout << "Lysine";
  32.                 i++;
  33.                 a = true;
  34.             }
  35.             if (s[i] == 'T' and s[i+1] == 'A') break;
  36.             if (s[i] == 'T' and s[i+1] == 'T') break;
  37.         }
  38.     }
  39.     if (!a) cout << "None";
  40.     cout << endl;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement