Cod sursa(job #130886)
Utilizator | Data | 2 februarie 2008 14:09:58 | |
---|---|---|---|
Problema | Text | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include<stdio.h>
char x;
int b,ok,a;
int main(){
FILE *f=fopen("text.in","r");
while(1==1){
fscanf(f,"%c",&x);
if(feof(f)||x=='\n')break;
if(x>=65&&x<=90||x>=97&&x<=122){
b++;
if(ok==1)a++;
ok=0;
}
else{
ok=1;
}
}
fclose(f);
FILE *g=fopen("text.out","w");
fprintf(g,"%d",b/a);
fclose(g);
return 0;
}