Cod sursa(job #708764)
Utilizator | Data | 7 martie 2012 10:11:53 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include <stdio.h>
FILE *f=fopen("text.in","r"),*g=fopen("text.out","w");
long long nrlit=0,nrcuv=0;
bool k=0;
char ch;
int main()
{
while(!feof(f)){
fscanf(f,"%c",&ch);
if ((ch>='a' && ch<='z') ||(ch>='A' && ch<='Z')){
nrlit++;
k=1;
}
else if(k==1){
nrcuv++;
k=0;
}
}
fprintf(g,"%lld",nrlit/nrcuv);
return 0;
}