Cod sursa(job #252188)

Utilizator drag0s93Mandu Dragos drag0s93 Data 3 februarie 2009 23:18:07
Problema Text Scor 80
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.56 kb
#include<stdio.h>

#include<iostream>

#define N 10000000

using namespace std;





long long solve()
{
	freopen("text.in","r",stdin);
	int litere=0,cuvinte=0;
	char ch,cch;
	while(scanf("%c",&ch)!=EOF)
	{
		if(ch>='a'&& ch<='z' || ch>='A' && ch<='Z')
			++litere;
		if((ch<'A' || ch>'Z' && ch<'a' || ch>'z') && (cch>='A' && ch<='Z' || ch>='a' && ch<='z'))
			++cuvinte;
		cch=ch;
	}
	return litere/cuvinte;
}
void afisare()
{
	freopen("text.out","w",stdout);
	printf("%lld",solve());
}
int main()
{
	solve();
	afisare();
	return 0;
}