Untitled
unknown
plain_text
a year ago
759 B
19
Indexable
#include <bits/stdc++.h>
using namespace std;
void De_lesseps() {
int cnt{};
string s;
while (cin >> s) {
for (int i = 0;i<s.size();i++)
if (s[i] == '?' || s[i] == '.' || s[i] == ',' | s[i] == '!')
s[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