Cod sursa(job #560878)

Utilizator puya.tudorPuia Tudor puya.tudor Data 18 martie 2011 18:45:49
Problema Text Scor 80
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include<iostream>
#include<fstream>
#include<cctype>
using namespace std;

int main()
{
	float t=0,w=0;
	char c,b;
	ifstream In("text.in");
	In.get(c);
	if( isalpha(b) ) 
	{
		t++;
		w++;
	}
	while(In.get(c))
	{
		if( isalpha(c) )
		{
			t++;
			if( !isalpha(b) ) w++;
		}
		b=c;
	}
	In.close();
	ofstream Out("text.out");
	Out<<(int)(t/w);
	Out.close();
	return 0;
}