Cod sursa(job #155141)

Utilizator jeanFMI - Petcu Ion Cristian jean Data 11 martie 2008 19:22:45
Problema Text Scor 60
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include<stdio.h>
char c;
int cuv=0,l=0;
int main()
{
FILE *f=fopen("text.in","r");

while(!feof(f))
{fscanf(f,"%c",&c);

if(c>=65&&c<=90||c>=97&&c<=122||c>=48&&c<=57)
    {cuv++;
     while(c>=65&&c<=90||c>=97&&c<=122||c>=48&&c<=57)
      {l++;
       fscanf(f,"%c",&c);
       }
    }
}
fclose(f);
FILE *g=fopen("text.out","w");
fprintf(g,"%d",l/cuv);
fclose(g);
return 0;
}