Cod sursa(job #258104)

Utilizator cosmin79Carabet Cosmin Andrei cosmin79 Data 14 februarie 2009 18:33:22
Problema Text Scor 90
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.41 kb
#include <stdio.h>
#define NR 1050000
int main()
{
	freopen("text.in","r",stdin);
	freopen("text.out","w",stdout);
	int litere=0,cuv=0;
	char x,y;
	while (scanf("%c",&x)!=EOF)
	{
		if ((x>='a' && x<= 'z') || (x>='A' && x<= 'Z'))
			litere++;
		else
			if ((y>='a' && y<= 'z') || (y>='A' && y<= 'Z') && (x<'A' || (x>'Z' && x<'a') || x>'z'))
				++cuv;
		y=x;	
	}
	printf("%d",litere/cuv);
	return 0;
}