Pagini recente » Cod sursa (job #2335894) | Cod sursa (job #2704929) | Cod sursa (job #178187) | Cod sursa (job #1438575) | Cod sursa (job #1394136)
#include <stdlib.h>
#include <stdio.h>
int main()
{
FILE* input;
input = fopen("text.in","r");
int count = 0;
int total = 0;
while( !feof(input) )
{
int c = fgetc(input);
if ( c == (int)(' ') )
{
count++;
}
if ( ( 64 < c && c < 91 ) || ( 96 < c && c < 123 ) )
{
++total;
}
}
FILE* output;
output = fopen("text.out","w");
fprintf(output,"%d",total/(count+1));
fclose(input);
return 0;
}