Pagini recente » Cod sursa (job #257478) | Cod sursa (job #1417645) | Cod sursa (job #2378396) | Cod sursa (job #2223867) | Cod sursa (job #521381)
Cod sursa(job #521381)
#include<stdio.h>
FILE *in,*out;
long 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;
};
if(c_ant>=65 && c_ant<=90 || c_ant>=97 && c_ant<=122)
cuvinte++;
if(cuvinte)
fprintf(out,"%d",litere/cuvinte);
else
fprintf(out,"0");
return 0;
}