Cod sursa(job #694277)

Utilizator darle.gheorgheDarle Gheorghe darle.gheorghe Data 27 februarie 2012 19:37:29
Problema Text Scor 50
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.33 kb
#include<stdio.h>
#include<string.h>
FILE *fin, *fout;
main()
{
fin = fopen("text.in","r");
fout = fopen("text.out","w");
char c,s;
long l,nr,f,i;
nr=1;
l=0;
while(fscanf(fin,"%c",&c)!=EOF)
	{
	if(c>='a' && c<='z' || c>='A' && c<='Z')
		l++;
	if(c!=' ' && s==' ')
		nr++;
	s=c;
	}
f=l/nr;
fprintf(fout,"%d",f);
}