Cod sursa(job #570935)
| Utilizator | Data | 3 aprilie 2011 19:37:17 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.35 kb |
#include<stdio.h>
FILE*fin,*fout;
int i,nrcuv,nrl,ok;
char ch;
int main(){
fin=fopen("text.in","r");
fout=fopen("text.out","w");
fscanf(fin,"%c",&ch);
ok=0;
while(ch!=EOF){
ch=ch-32;
if(ch<='z'&&ch>='a'&&ok==0){ok=1;nrl=1;nrcuv++;ok=0;}
else if(ch<='z'&&ch>='a'&&ok==1){nrl++;}
else{ok=0;}
}
fprintf(fout,"%d",nrl/nrcuv);
return 0;
}
