fork(1) download
  1. /// Вариант 1.
  2.  
  3. #include <iostream>
  4. #include <string>
  5. #include <cctype>
  6.  
  7. void strToUpper(std::string& str);
  8.  
  9. int main()
  10. {
  11. std::string i = "Don't WORRY be HAPPY.";
  12. strToUpper(i);
  13.  
  14. return 0;
  15. }
  16.  
  17. void strToUpper(std::string& str)
  18. {
  19. for (auto c : str)
  20. {
  21. c = toupper(c);
  22. std::cout << c;
  23. }
  24. }
Success #stdin #stdout 0s 3476KB
stdin
Standard input is empty
stdout
DON'T WORRY BE HAPPY.