Cod sursa(job #24609)
Utilizator | Data | 3 martie 2007 01:01:54 | |
---|---|---|---|
Problema | Text | Scor | 50 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include<stdio.h>
#include<iostream.h>
main()
{
char a,s;
long i,j,k,n;
FILE *f,*g;
f=fopen("text.in","r");
g=fopen("text.out","w");
i=0;j=0;
while (!feof(f))
{
fscanf(f,"%c",&a);
if(a==' ')i++;
if((a>=65)&&(a<=90))j++;
if((a>=97)&&(a<=122))j++;
}
i++;
k=j/i;
fprintf(g,"%ld",k);
fclose(f);
fclose(g);
return 0;
}