Cod sursa(job #37062)
Utilizator | Ionut Bogdanescu swift90 | Data | 24 martie 2007 15:54:15 |
---|---|---|---|
Problema | Text | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include<stdio.h>
int main(){
FILE*in=fopen("text.in","r");
FILE*out=fopen("text.out","w");
int lit=0,cuv=0,k=0;
char a;
fscanf(in,"%c",&a);
while(fscanf(in,"%c",&a)!=EOF){
if(((a>='a')&&(a<='z'))||((a>='A')&&(a<='Z'))||((a>='0')&&(a<='9'))){
lit++;
if(k==0)
cuv++;
k=1;
}
else
k=0;
}
fprintf(out,"%d\n",lit/cuv);
return 0;
}