Pagini recente » Cod sursa (job #1098166) | Cod sursa (job #2097704) | Cod sursa (job #1418968) | Cod sursa (job #1298120) | Cod sursa (job #2764250)
#include <bits/stdc++.h>
using namespace std;
int const SZ = 1e6;
char buff [SZ];
int getword (int &p){
int r = 0;
while (p != SZ && ! isalpha (buff [p]))
++ p;
while (p != SZ && isalpha (buff [p]))
++ r , ++ p;
return r;
}
int main (){
freopen ("text.in" , "r" , stdin);
freopen ("text.out" , "w" , stdout);
fread (buff , 1 , SZ , stdin);
int p = 0 , L = 0 , lit , cuv = 0;
while (lit = getword (p))
++ cuv , L += lit;
printf ("%d" , L / cuv);
return 0;
}