Cod sursa(job #37087)
Utilizator | Data | 24 martie 2007 16:42:48 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 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;
while(fscanf(in,"%c",&a)!=EOF){
if(((a>='a')&&('z'>=a))||((a>='A')&&('Z'>=a))){
lit++;
if(k==0)
cuv++;
k=1;
}
else
k=0;
}
fprintf(out,"%d\n",lit/cuv);
return 0;
}