Cod sursa(job #329818)

Utilizator ZethpixZethpix Zethpix Data 7 iulie 2009 18:19:25
Problema Text Scor 90
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.33 kb
#include <stdio.h>
FILE *f,*g;
char c;
int ok;
long s,n;
int main(){
	f=fopen("text.in","r");
	g=fopen("text.out","w");
	while (!feof(f)){
		fscanf(f,"%c",&c);
		if (65<=c&&c<=90||97<=c&&c<=122){
			ok=1;
			n++;
		}
		else
			if (ok==1){
				ok=0;
				s++;
			}
	}
	fprintf(g,"%ld\n",n/s);
	fclose(f);
	fclose(g);
}