Cod sursa(job #2781563)
| Utilizator | Data | 9 octombrie 2021 20:09:05 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.49 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin ("text.in");
ofstream fout("text.out");
bool is_letter(char a) {
return ((a >= 'a' && a <= 'z') || (a >= 'A' && a <= 'Z'));
}
int main() {
char a;
int t = 0, nr = 0;
bool last = 0;
while(fin.get(a)) {
if(is_letter(a)) {
t++;
if(!last) {
last = 1;
nr++;
}
} else last = 0;
}
fout << t / nr << '\n';
}