Cod sursa(job #838676)

Utilizator TudorMTudor Moldovanu TudorM Data 20 decembrie 2012 12:27:40
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.32 kb
#include<fstream>

using namespace std;

ifstream f("text.in");
ofstream g("text.out");
char a;
int k, s, t;
int main()
{
	k=0;
	s=1;
	t=0;
	while(f.get(a))
	{
		if(('a'<=a&&a<='z')||('A'<=a&&a<='Z'))k++;
		else {
			if(k)s++;
			t=t+k;
			k=0;
		}
	}
	g<<k/s;
	f.close();
	g.close();
	return 0;
}