Cod sursa(job #21054)
Utilizator | Data | 22 februarie 2007 20:58:42 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | c | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
//text
#include <stdio.h>
int main ()
{long s=0, sc=0;
char c;
FILE *fi, *fo;
fi=fopen("text.in","r");
fo=fopen("text.out","w");
while (!feof(fi))
{
fscanf(fi,"%c",&c);
while (c!=' '&&c!='!'&&c!=','&&c!='?')
{
s++;
fscanf(fi,"%c",&c);
}
sc++;
}
fprintf(fo,"%ld",s/sc);
fclose(fi);
fclose(fo);
return 0;
}