fork(1) download
  1. #include <iostream>
  2. #include <algorithm>
  3.  
  4. using namespace std;
  5.  
  6. void Powieksz(string& p)
  7. {
  8. if (p.empty()) return;
  9. transform(p.begin(), p.end(), p.begin(), ::tolower);
  10. p[0] = ::toupper(p[0]);
  11. }
  12.  
  13. int main()
  14. {
  15. string tekst;
  16. while (cin >> tekst)
  17. {
  18. Powieksz(tekst);
  19. cout << tekst << " ";
  20. }
  21. return 0;
  22. }
Success #stdin #stdout 0s 3476KB
stdin
ala ma kota

aLa mA KOTA
stdout
Ala Ma Kota Ala Ma Kota