Cod sursa(job #1217066)

Utilizator petcuraluca810Petcu Raluca petcuraluca810 Data 6 august 2014 15:58:45
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.42 kb
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int nrc, nrl;
int main()
{ 	int ok=0;
	char x;
	fin.get(x);
	while (x!='\n'&&(!fin.eof()))
		{
		if (x>='a'&&x<='z'||x>='A'&&x<='Z')
			{
			nrl+=1;
			if (ok==0)
				{
				nrc+=1;
				ok=1;
				}
			}
			else 
			ok=0;
		fin.get(x);
		}
	fout<<nrl/nrc;
	fout<<'\n';
	fin.close();
	fout.close();
	return 0;
}