Cod sursa(job #634377)
Utilizator | Data | 16 noiembrie 2011 02:49:46 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | c | Status | done |
Runda | Arhiva de probleme | Marime | 0.51 kb |
#include <stdio.h>
#include <stdlib.h>
void citire()
{
FILE *f=fopen("text.in","r");
FILE *g=fopen("text.out","w");
int count=0,ok=0,cuv=0;
char c;
while(c!=EOF)
{
if(isalpha(c))
{
count++;
ok=1;
}
else
ok=0;
c=fgetc(f);
if(isalpha(c)&& ok==0)
cuv++;
}
fprintf(g,"%d",count/cuv);
}
int main()
{
citire();
return 0;
}