Cod sursa(job #786787)

Utilizator ArmandNMArmand Nicolicioiu ArmandNM Data 12 septembrie 2012 01:46:01
Problema Text Scor 50
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include <fstream>
#include <string>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int med,cuv,lit,ascii;
char c;
int main()
{
	while(f.get(c))
	{
		ascii=c;
		if (ascii>64 && ascii<91 ) lit++;
		if (ascii>96 && ascii<123) lit++;
		if (c==' ') cuv++;
	}
	cuv++;
	if (cuv==0) med=0; 
	else
	med=lit/cuv;
	g<<med;
	f.close();
	g.close();
	return 0;
}