Pagini recente » Cod sursa (job #300022) | Cod sursa (job #1851963) | Cod sursa (job #2782861) | Cod sursa (job #3259709) | Cod sursa (job #926773)
Cod sursa(job #926773)
#include <stdio.h>
int main()
{
FILE *in,*out;
int b=1,nrl=0,gasit=0,nrc=0;
char ch;
in=fopen("text.in","r");
out=fopen("text.out","w");
while(b==1)
{
ch=fgetc(in);
if(ch!=EOF)
{
if((ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z'))
{
nrl++;
if(gasit==0)
gasit=1;
}
else
{
if(gasit==1)
{
nrc++;
gasit=0;
}
}
}
else
b=0;
}
fprintf(out,"%d",nrl/nrc);
return 0;
}