Cod sursa(job #111434)

Utilizator kojocojocaru aurelian kojo Data 29 noiembrie 2007 20:28:06
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.32 kb
#include<fstream.h>
#include<string.h>
#include<stdio.h>
#include<io.h>
ifstream f("text.in");
ofstream g("text.out");
char x;
int k,q,p;//q-nr de cuvinte,p-nr de caractere
int main()
{
while(f.get(x))
{if((x>='A'&&x<='Z')||(x>='a'&&x<='z'))
	{p++;k=0;}
	else
		if(!k)
		{q++;k=1;}
}
g<<p/q;
return 0;
}