Cod sursa(job #627742)

Utilizator alexalghisiAlghisi Alessandro Paolo alexalghisi Data 30 octombrie 2011 16:46:29
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.55 kb
#include <cstdio>
#include <iostream>
#define DN 1024*1025
using namespace std;

char x;

int main()
{
	int nrcuv=0,nrlitere=0;
	freopen("text.in","r", stdin);
	freopen("text.out","w", stdout);
	
	bool ok=false;
	while(!feof(stdin))
	{
		scanf("%c",&x);
		ok=false;
		while((x>='a' && x<='z') || (x>='A' && x<='Z')) 
		{
			nrlitere++;
			ok=true;
			scanf("%c",&x);
		}	
		if(ok==true) nrcuv++;
		//if(x[j]=='!' || x[j]=='?' || x[j]=='.') break
	}
	
	printf("%d",nrlitere/nrcuv);
	
	fclose(stdin);
	fclose(stdout);
	return 0;
}