Advertisement
kolioi

Untitled

Dec 12th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. //100/100
  2. //Memory: 1.76 MB Time : 0.388 s
  3. #include <iostream>
  4.  
  5. #define DNA_LENGTH 6
  6. #define DOT 46
  7.  
  8. using namespace std;
  9.  
  10. int main()
  11. {
  12.     char ch, result[DNA_LENGTH]{ 0 };
  13.     size_t currIndex = 0;
  14.     while ((ch = getchar()) != DOT)
  15.     {
  16.         result[currIndex++] ^= ch;
  17.         if (currIndex == DNA_LENGTH - 1)
  18.             currIndex = 0;
  19.     }
  20.  
  21.     cout << result << endl;
  22.  
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement