fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. int main(){
  5. string name;
  6. getline(cin , name);
  7. stringstream ss(name);
  8. string tmp;
  9. string n = "";
  10. while(ss >> tmp){
  11. tmp[0] = toupper(tmp[0]);
  12. for(int i = 1;i < tmp.length();i++){
  13. tmp[i] = tolower(tmp[i]);
  14. }
  15. n += tmp + " ";
  16. }
  17. n.pop_back();
  18. name = n;
  19. cout << name << endl;
  20. return 0;
  21. }
Success #stdin #stdout 0s 5320KB
stdin
nguyen van nam
stdout
Nguyen Van Nam