Cod sursa(job #1477166)
Utilizator | Data | 25 august 2015 17:25:48 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include<stdio.h>
int main()
{
int nl=0,nc=0,ok=0;
char ch;
FILE* f1,*f2;
f1=fopen("text.in","r");
f2=fopen("text.out","w");
while(!feof(f1))
{
fscanf(f1,"%c",&ch);
if((ch>='a' && ch<='z') || (ch>='A' && ch<='Z'))
{
nl++;
if(!ok)
{
nc++;
ok=1;
}
}
else ok=0;
}
fprintf(f2,"%d",nl/nc);
return 0;
}