Cod sursa(job #1731998)
Utilizator | Data | 20 iulie 2016 15:59:14 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | c | Status | done |
Runda | Arhiva de probleme | Marime | 0.45 kb |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
int main()
{
FILE *pf,*pg;
pf=fopen("text.in","r");
pg=fopen("text.out","w");
char s;
int k1=0,k2=0,ok=0;
while (!feof(pf))
{fscanf(pf,"%c",&s);
if (isalpha(s))
{k1++;
ok=1;
}
else if (ok)
{k2++;
ok=0;}}
fprintf(pg,"%d",k1/k2);
return 0;
}