Untitled

 avatar
user_3347586
plain_text
a month ago
627 B
1
Indexable
#include <bits/stdc++.h>

using namespace std;

void De_lesseps() {
    string s;
    getline(cin, s);
    int counter = 0;
    for (int i = 0; i < s.size(); ++i) {
        if (!(s[i] >= 'A' && s[i] <= 'z') && (s[i + 1] >= 'A' && s[i + 1] <= 'z'))
            counter++;
        else
            continue;
    }
    if (s[0] >= 'A' && s[0] <= 'z')
        cout << counter + 1;
    else
        cout << counter;
}

int main() {
    ios::sync_with_stdio(false),
            cin.tie(nullptr),
            cout.tie(nullptr);
    int t{1};
    while (t--) {
        De_lesseps();
    }
    return 0;
}
Leave a Comment