Cod sursa(job #778941)

Utilizator DaNutZ2UuUUBB Bora Dan DaNutZ2UuU Data 16 august 2012 12:11:45
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.36 kb
#include<fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int lg,nrc,ok;
char s[300],*p,x;
int main()
{
	
	ok=nrc=0;
	while(f.get(x))
	{
		if((x<='z'&&x>='a')||(x<='Z'&&x>='A'))
			{
				lg++;
				ok=1;
			}
		else
			if(ok==1)
			{
				nrc++; 
				ok=0;
			}
	}
	if(ok)
		nrc++;
	g<<int(lg/nrc);
	return 0;
}