Cod sursa(job #310205)

Utilizator DuxarFII-Stefan-Negrus Duxar Data 1 mai 2009 22:46:47
Problema Text Scor 70
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.51 kb
#include<iostream.h>
#include<fstream.h>
char x,y;
int main()
{
int nrc,lcuv;
ifstream f("text.in");
ofstream g("text.out");
f.get(x);
lcuv=nrc=0;
while (!f.eof())
	{
	while ((x>='a'&&x<='z')||(x>='A'&&x<='Z')&&(!f.eof()))
		{
		++lcuv;
		y=x;
		f.get(x);
		}
	if (!(x>='a'&&x<='z')&&!(x>='A'&&x<='Z')&&((y>='a'&&y<='z')||(y>='A'&&y<='Z')))
		{
		++nrc;
		y=x;
		}
	while (!(x>='a'&&x<='z')&&!(x>='A'&&x<='Z')&&(!f.eof()))
		f.get(x);
	}
g<<lcuv/nrc;
f.close();
g.close();
return 0;
}