Cod sursa(job #500747)

Utilizator FERI24Forrai Francisc FERI24 Data 12 noiembrie 2010 22:53:31
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include<fstream>
#include<string>
using namespace std;

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

int main()
{
	char a;
	int nrc = 0, nrl = 0, k = 0;
	
	while( fin.get(a) )
	{
		if( isalpha(a) )
		{
				nrl++;
		if( k == 0 )
				nrc++;
		k = 1;
		}
		else
		k = 0;
	}
	
	fout << nrl/nrc << '\n';
	
	//fout << nrl <<'\n';
	//fout << nrc << '\n';
	
	fin.close();
	fout.close();
	
	return 0;
}