Pagini recente » Cod sursa (job #2976450) | Cod sursa (job #2674416) | Cod sursa (job #1606374) | Cod sursa (job #2548008) | Cod sursa (job #521373)
Cod sursa(job #521373)
#include<stdio.h>
FILE *in,*out;
int i,litere,cuvinte;
char c,c_ant;
int main()
{
in=fopen("text.in","rt");
out=fopen("text.out","wt");
while(!feof(in))
{
fscanf(in,"%c",&c);
if(c>=65 && c<=90 || c>=97 && c<= 122)
litere++;
else
if(c_ant>=65 && c_ant<=90 || c_ant>=97 && c_ant<=122)
cuvinte++;
c_ant=c;
};
fprintf(out,"%d",litere/cuvinte);
return 0;
}