Cod sursa(job #554628)

Utilizator romircea2010FMI Trifan Mircea Mihai romircea2010 Data 14 martie 2011 23:59:29
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include <fstream>

using namespace std;

char ch;
int nrl, nrc;

int main ()
{
	ifstream f ("text.in");
	int ok=0;
	while (f.get (ch))
	{
		if ((ch>='a' && ch<='z') || (ch>='A' && ch<='Z'))
		{
			nrl++;
			if (ok==0)
			{
				ok=1;
				nrc++;
			}
		}
		else
			ok=0;
	}
	f.close ();
	
	ofstream g ("text.out");
	g<<(nrl/nrc)<<"\n";
	g.close();
	
	return 0;
}