Cod sursa(job #49222)

Utilizator tvladTataranu Vlad tvlad Data 5 aprilie 2007 16:25:29
Problema Text Scor 90
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.37 kb
#include <cstdio>

int main() {
	freopen("text.in","r",stdin);
	freopen("text.out","w",stdout);
	bool cuv;
	char ch;
	int cuvlen = 0,ncuv = 0;
	while (!feof(stdin)) {
		ch = fgetc(stdin);
		if ('a' <= ch && ch <= 'z' ||
		    'A' <= ch && ch <= 'Z') {
			++cuvlen;
			cuv = true;
		} else
		if (cuv) {
			++ncuv;
			cuv = false;
		}
	}
	printf("%d\n",cuvlen/ncuv);
	return 0;
}