fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void cypher(char &c);
  5.  
  6. int main(){
  7. string input;
  8. while(getline(cin, input)){
  9. int len = input.length();
  10. for(int i=0;i<len;i++){
  11. cypher(input[i]);
  12. }
  13. cout << input << endl;
  14. }
  15.  
  16. return 0;
  17. }
  18.  
  19. void cypher(char &c){
  20. c = c >= 33 && c <= 79 ? c+46 : c >= 80 && c <= 125 ? c-46 : c;
  21. }
Success #stdin #stdout 0s 3476KB
stdin
ro& o%v
stdout
DAT ASH