Cod sursa(job #393315)

Utilizator AnteusPatrascoiu Mihai Anteus Data 9 februarie 2010 10:48:22
Problema Text Scor 90
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.34 kb
#include <stdio.h>
#include <ctype.h>
FILE *f=fopen ("text.in", "r");
FILE *g=fopen ("text.out", "w");
char x;
int k,nr,i,sw;

int main() {

while (!feof(f))
{
	fscanf (f, "%c", &x);
	if (isalpha (x))
		{ k++; sw=1; }
	else
		if (sw)
			{ nr++; sw=0; }
}
fprintf (g, "%d", k/nr);
return 0;
fclose(f);
fclose(g);
}