Cod sursa(job #483485)

Utilizator freakingVlad Eu freaking Data 8 septembrie 2010 22:06:07
Problema Text Scor 50
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.44 kb
#include <string.h>
#include <fstream>
using namespace std;

ifstream in("text.in");
ofstream out("text.out");


int main()
{
	char x[1];
	int ok,cuv=0,lit=0;
	while(in.get(x[0]))
	{	
		if(strcmp("a",x)<=0 && strcmp(x,"z")>=0) 
		{	
			ok=1;
			lit++;
		}
		else
			if(strcmp("A",x)<=0 && strcmp(x,"Z")>=0)
			{	
				ok=1;
				lit++;
			}
			else
				if(ok==1)
				{
					ok=0;
					cuv++;
				}
	}
	out<<lit/cuv;
	
}