Pagini recente » Profil moga_florian | Istoria paginii runda/hoata2 | Monitorul de evaluare | Statistici berian grartian (beriangratian) | Cod sursa (job #1034717)
#include <iostream>
#include <cstdio>
#include <cstring>
FILE *f,*g;
using namespace std;
int main()
{
f=fopen("text.in","r");
g=fopen("text.out","w");
char c;
long cuvinte=0,lungime=0,sem;
sem=0;
while(!feof(f))
{
fscanf(f,"%c",&c);
if(c>='A'&&c<='z')
{
lungime++;
if(!sem)
{
sem=1;
}
}
else
{
if(sem)
{
cuvinte++;
sem=0;
}
}
}
fprintf(g,"%ld",lungime/cuvinte);
fclose(f);
fclose(g);
return 0;
}