Cod sursa(job #649288)

Utilizator tzoky07Alexandru Gaman tzoky07 Data 15 decembrie 2011 18:04:12
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include <fstream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <iostream>

int main()
{
char c;
long x=0,cv=0,g=1;
ifstream fin("text.in");
ofstream fout("text.out");
do{
fin.get(c);
if(!fin.eof())
{
	if((((int)c>=97)&&((int)c<=122)) || (((int)c>=65) && ((int)c<=90)))
	{   x++;  
	if(g==1) { cv++; g=0; } }
	else g=1;
}
}while(!fin.eof());
fin.close();
fout<<floor(x/cv);
fout.close();
return 0;
}