Cod sursa(job #727837)

Utilizator ajshookZamfir Gabriel ajshook Data 28 martie 2012 12:16:42
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.3 kb
#include<fstream>
#include<string>
using namespace std;
int l,c;
char a;
int main()
{
	ifstream f("text.in");
	int ok=0;
	f.get(a);
	while(!f.eof())
	{
		if(isalpha(a))
		{
			l++;
			ok=1;
		}
		else if(ok==1)
		{
			ok=0;
			c++;
		}
		f.get(a);
	}
	f.close();
	ofstream g("text.out");
	g<<l/c;
	g.close();
}