fork(2) download
  1. #include <algorithm>
  2. #include <cctype>
  3. #include <string>
  4. #include <iostream>
  5.  
  6. using namespace std;
  7. int main()
  8. {
  9. string text = "Abc123DEfHello";
  10. cout << text << "\n";
  11. //...
  12. std::transform(text.begin(), text.end(), text.begin(), [](char c)
  13. { return isupper(c)?tolower(c):toupper(c); });
  14. cout << text << "\n";
  15. }
Success #stdin #stdout 0s 3272KB
stdin
Standard input is empty
stdout
Abc123DEfHello
aBC123deFhELLO