Pagini recente » Cod sursa (job #1389064) | Cod sursa (job #240029) | Cod sursa (job #2295060) | Cod sursa (job #134990) | Cod sursa (job #1014946)
#include<stdio.h>
int main()
{
int cuvinte=0,lungimeText=0,rez=0;
char c,d;
FILE *f = fopen("text.in","r");
{
while( (c=fgetc(f)) != EOF )
{
if(c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z')
rez++;
else
{
if(rez!=0)
{
lungimeText += rez;
cuvinte++;
rez = 0;
}
}
}
fclose(f);
}
f = fopen("text.out","w");
{
fprintf(f,"%d",lungimeText/cuvinte);
fclose(f);
}
return 0;
}