Untitled

 avatar
unknown
plain_text
2 months ago
730 B
8
Indexable
#include <bits/stdc++.h>

using namespace std;

void De_lesseps() {
    int cnt{};
    string s;
    while (cin >> s) {
        for (auto &i: s)
            if (i == '?' || i == '.' || i == ',' | i == '!')
                i = ' ';
        int i = 0;
        while (i < s.size()) {
            if (s[i] >= 'A' and s[i] <= 'z') {
                while (i < s.size() and s[i] != ' ')
                    i++;
                cnt++;
            } else
                i++;
        }
    }
    cout << cnt << endl;
}

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