Cod sursa(job #155035)
Utilizator | Data | 11 martie 2008 17:56:27 | |
---|---|---|---|
Problema | Text | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 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)
{cuv++;
while(c>=65&&c<=90||c>=97&&c<=122)
{l++;
fscanf(f,"%c",&c);
}
}
}
fclose(f);
FILE *g=fopen("text.out","w");
fprintf(g,"%d",l/cuv);
fclose(g);
return 0;
}