Cod sursa(job #404730)
Utilizator | Data | 26 februarie 2010 16:53:44 | |
---|---|---|---|
Problema | Text | Scor | 90 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include<stdio.h>
#include<string.h>
char x;
int cuv,lit,ok;
int main(){
FILE * f = fopen("text.in","r");
FILE * g = fopen("text.out","w");
while(fscanf(f,"%c",&x)!=EOF){
if(('a'<=x&& x<='z')||('A'<=x && x<='Z')){
lit++;
ok=1;
}
else{
if(ok==1)
cuv++;
ok=0;
}
}
fprintf(g,"%d",lit/cuv);
fclose(f);
fclose(g);
return 0;
}