Cod sursa(job #1251869)

Utilizator benisavuSavu Beniamin benisavu Data 29 octombrie 2014 23:02:00
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.49 kb
#include<stdio.h>
#include<string.h>
int main()
{
	FILE *f,*g;
	f=fopen("text.in", "r");
	g=fopen("text.out", "a");
		char t;
		int aux=0,c=0,l=0;
		while(!(feof(f)))
			{	t=getc(f);
				if((t<='z' && t>=97)||(t<='Z' && t>=65))
        {
            l++;
            aux=1;
        }
        else
            if(aux!=0)
            {
                c++;
                aux=0;
            }
		
			}
    fprintf(g,"%d",l/c);
	fclose(f);
	fclose(g);
	return 0;
}