Cod sursa(job #2703053)
Utilizator | Data | 6 februarie 2021 21:31:33 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char s[250001];
int main(){
f.getline(s, sizeof(s));
int lch = 0, nrch = 0;
for(int i = 0;s[i];i++){
bool ok = 0;
int L = 0;
while(s[i] && isalpha(s[i])) ok = 1, L++, i++;
if(ok)
lch += L, nrch++;
}
g << lch / nrch;
}