Cod sursa(job #1435349)

Utilizator CTI_KnightCir Constantin CTI_Knight Data 12 mai 2015 22:03:33
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.46 kb
# include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int n,nr,cuv;
char x,y;
int litera(char a)
{
	 if((a>=65 && a<=90) || (a>=97 && a<=122) )
        return 1;

        return 0;
}
int main()
{
	nr = 0;
	cuv = 0;
	x = 0;
	while( f >> noskipws >>y )
	{
		
		if( litera(y) == 1 )
		nr ++;
		if(x != 0)
		if( litera(y) == 0 )
			if( litera(x) == 1)
				cuv ++;
				
		x = y;
	}
	g << nr / cuv;
	return 0;
}