Cod sursa(job #834848)

Utilizator BogdanMacoMacovei Bogdan BogdanMaco Data 15 decembrie 2012 14:29:21
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.34 kb
#include <fstream>
#include<iostream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
	int z=0,y=0,c=0;
	char x;
	while(fin.get(x))
	{
		if(('a'<=x && x<='z')||('A'<=x && x<='Z'))z+=1;
		else
		{
			if(z!=0)y++;
			m=m+z;
			z=0;

		}
	}
	fout<<m/y;
	fin.close();
	fout.close();
	return 0;
}