Cod sursa(job #642852)

Utilizator pandreeaePopescu Andreea pandreeae Data 2 decembrie 2011 13:47:17
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.37 kb
#include <stdio.h>
#include <string.h>
using namespace std;

int main ()
{
	freopen("text.in","r",stdin);
	freopen("text.out","w",stdout);
	char x;
	int l=0, c=0;
	bool ok=true;
	while(scanf("%c",&x)==1){
		if((x>='a'&&x<='z')||(x>='A'&&x<='Z')){
			if(ok==true){
				ok=false;
				c++;}
			l++;}
		else
			ok=true;}
	printf("%d",(int)(l/c));
	return 0;
}