fork download
  1. #include <iostream>
  2. #include <sstream>
  3. using namespace std;
  4.  
  5. int main() {
  6. string s;
  7. getline(cin, s);
  8. stringstream ss(s);
  9. string tmp;
  10. while (ss >> tmp) {
  11. int n = tmp.size();
  12. cout << (char)toupper(tmp[0]);
  13. for (int i = 1; i < n; ++i) cout << (char)tolower(tmp[i]);
  14. cout << ' ';
  15. }
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5324KB
stdin
nguYEn Van     aN
stdout
Nguyen Van An