Pagini recente » Borderou de evaluare (job #1572994) | Borderou de evaluare (job #1277892) | Borderou de evaluare (job #432813) | Borderou de evaluare (job #1657100) | Cod sursa (job #640282)
Cod sursa(job #640282)
#include <cstdio>
int main()
{
char c;
bool t = false;
int word = 0,chr = 0;
FILE*f;
f = fopen("text.in","r");
while (!feof(f))
{
fscanf(f,"%c",&c);
if ( (t) && !( (c>65) && (c<127) ) )
{
chr++;
t = false;
}
if ( (c>65) && (c<127) )
{
word++;
t = true;
}
}
fclose(f);
f=fopen("text.out","w");
fprintf(f,"%d",word/chr);
fclose(f);
return 0;
}