fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <iterator>
  4. #include <algorithm>
  5. #include <cctype>
  6. using namespace std;
  7.  
  8. int main() {
  9. auto translate = [](char c) -> int{
  10. auto check = string("wqka");
  11. auto pos = check.find(c);
  12. return pos != string::npos?
  13. pos+11 : c;
  14. };
  15.  
  16. transform(
  17. istreambuf_iterator<char>(cin),
  18. istreambuf_iterator<char>(),
  19. ostream_iterator<int>(cout, " "),
  20. [&](char c){ return translate(tolower(c)); }
  21. );
  22. return 0;
  23. }
Success #stdin #stdout 0s 3460KB
stdin
wQkacostenteges
stdout
11 12 13 14 99 111 115 116 101 110 116 101 103 101 115