Cod sursa(job #1394136)
| Utilizator | Data | 20 martie 2015 01:05:21 | |
|---|---|---|---|
| Problema | Text | Scor | 50 |
| Compilator | c | Status | done |
| Runda | Arhiva de probleme | Marime | 0.39 kb |
#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;
}
