Cod sursa(job #2897226)
| Utilizator | Data | 2 mai 2022 22:45:59 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.6 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
bool let(char c) {
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}
int main() {
string s;
getline(fin, s);
long long lgt = 0, nrc = 0, lg = s.length();
int i = 0;
while (i < lg && !let(s[i]))
i++;
while (i < lg)
{
nrc++;
while (i < lg && let(s[i]))
i++, lgt++;
while (i < lg && !let(s[i]))
i++;
}
if (nrc == 0)
fout << 0;
else
fout << lgt / nrc;
return 0;
}