Cod sursa(job #2134905)

Utilizator Teodor.mTeodor Marchitan Teodor.m Data 18 februarie 2018 13:44:35
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.51 kb
#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
}

int main() {
	Boost();

	stringstream ss;

	char c;
	while(cin.get(c)) {
		if(isalpha(c))
			ss << c;
		else
			ss << " ";
	}

	string s;
	int nrCuvinte = 0, nrLitere = 0;

	while(ss >> s) {
		nrCuvinte++;
		nrLitere += (int)s.size();
	}

	cout << (int)(nrLitere / nrCuvinte);

	return 0;
}