fork(7) download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. string x="";
  9. while(cin >> x)
  10. {
  11. for(size_t i=0; i<x.size(); i+=2)
  12. {
  13. if(x[i+1]=='D')
  14. {
  15. cout << char(x[i]-'A');
  16. }
  17. else if(x[i+1]=='G')
  18. {
  19. cout << char(x[i]+31);
  20. }
  21. else if(x[i+1]=='H')
  22. {
  23. cout << char(x[i]+47);
  24. }
  25. else if(x[i+1]=='E')
  26. {
  27. cout << char(x[i]-1);
  28. }
  29. else if(x[i]=='F')
  30. {
  31. cout << char(x[i]+16);
  32. }
  33. }
  34. cout << endl;
  35. x="";
  36. }
  37. return 0;
  38. }
  39.  
Success #stdin #stdout 0s 3420KB
stdin
BGCGDGEGFGGGHGIGJGKG
LGBGEHBGDHEHCHPGGGBG
PGCGPGKHPGHHJGDHLGPG
stdout
abcdefghij
katastrofa
obozowisko