Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- char f(char c) {
- if (c >= 'a' && c <= 'z') {
- c -= 32;
- }
- return c;
- }
- int main() {
- string s;
- getline(cin, s);
- s[0] = f(s[0]);
- int x = s.find(" ");
- while(x != -1) {
- x++;
- s[x] = f(s[x]);
- x = s.find(" ", x);
- }
- cout << s;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement