Cod sursa(job #3040065)
Utilizator | Ciobanu Andrei Mihai amcbn | Data | 29 martie 2023 11:58:57 |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
/// [A][M][C][B][N] ///
#include <bits/stdc++.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
string str;
getline(fin, str);
for (auto& c : str) {
if (!isalpha(c)) {
c = ' ';
}
}
stringstream ss(str);
int cnt = 0, len = 0;
while (ss >> str) {
cnt++, len += str.size();
}
fout << len / cnt;
}