Cod sursa(job #874155)

Utilizator gerd13David Gergely gerd13 Data 7 februarie 2013 22:36:07
Problema Text Scor 0
Compilator cpp Status done
Runda cnlr_camp Marime 0.4 kb
#include<fstream>
#include<string.h>
using namespace std;
int main()

{
ifstream fin("text.in");
ofstream fout("text.out");
int litera=0, cuvant=0, suma=0, medie;
char s[200];
while(fin.get(s, 200))
{
if(('a'<s && s<='z')||('A'<=s && s<='Z'))
litera++;
else
{
if(litera)
cuvant++;
suma=suma+litera;
litera=0;
}
}
medie=suma/cuvant;
fout<<medie;
fin.close();
fout.close();
return 0;
}