Pagini recente » Cod sursa (job #1676008) | Cod sursa (job #2485357) | Cod sursa (job #569286) | Cod sursa (job #118379) | Cod sursa (job #2134825)
#include <bits/stdc++.h>
using namespace std;
inline void Boost() {
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
#endif
}
char sep[] = " .,;:!?-";
int main() {
Boost();
char text[1010];
cin.getline(text, 1010);
char *p = strtok(text, sep);
int nrCuvinte = 0, nrLitere = 0;
while(p) {
nrCuvinte++;
nrLitere += strlen(p);
p = strtok(NULL, sep);
}
cout << (int)(nrLitere / nrCuvinte);
return 0;
}