Untitled
user_9000366
plain_text
2 months ago
759 B
2
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