Cod sursa(job #1780272)
Utilizator | Data | 15 octombrie 2016 23:02:32 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | c | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include <stdio.h>
#include <ctype.h>
int lung,co;
int main()
{
FILE*fin,*fout;
fin=fopen("text.in","r");
fout=fopen("text.out","w");
char ch,prev=0;
while((ch=fgetc(fin))!=EOF)
{
if(isalpha(ch))
lung++;
else
if(isalpha(prev))
co++;
prev=ch;
}
fprintf(fout,"%d",lung/co);
fclose(fin);
fclose(fout);
return 0;
}