fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main () {
  7. cout << "> ";
  8. string dna; // << put the declaration 1st
  9. cin >> dna;
  10. cout << "< ";
  11. for(auto a : dna) {
  12. switch(a) {
  13. case 'A': cout << 'U';
  14. break;
  15. case 'C': cout << 'G';
  16. break;
  17. case 'G': cout << 'C';
  18. break;
  19. case 'T': cout << 'A';
  20. break;
  21. }
  22. }
  23. cout << " " << endl;
  24. return 0;
  25. }
Success #stdin #stdout 0s 3276KB
stdin
AGGGTCA
stdout
> < UCCCAGU