Advertisement
Guest User

Untitled

a guest
Feb 29th, 2020
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. char f(char c) {
  5.     if (c >= 'a' && c <= 'z') {
  6.         c -= 32;
  7.     }
  8.     return c;
  9. }
  10.  
  11.  
  12. int main() {
  13.     string s;
  14.     getline(cin, s);
  15.     s[0] = f(s[0]);
  16.     int x = s.find(" ");
  17.     while(x != -1) {
  18.         x++;
  19.         s[x] = f(s[x]);
  20.         x = s.find(" ", x);
  21.     }
  22.     cout << s;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement