Cod sursa(job #627739)

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

char x[DN];

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