Cod sursa(job #632441)

Utilizator ionut2103Covalschi Ionut ionut2103 Data 11 noiembrie 2011 09:46:08
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.33 kb
#include<fstream>
using namespace std;
int n,gasit,l; 
char x; 
int main()
{
	ifstream f("text.in");
	ofstream g("text.out");
	x=f.get();
	while(x!=EOF)
	{
		if((x>='a'&&x<='z')||(x>='A'&&x<='Z'))
		{
			gasit=0; 
			l++; 
		} 
		else 
			gasit++;
		if (gasit==1&&l!=0)
			n++;
		x=f.get();
	}
	g<<l/n;
	return 0;
}