Cod sursa(job #2148477)
Utilizator | Data | 1 martie 2018 19:06:40 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include<cstdio>
#include<cstring>
char ch[4000005];
int main(){
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
fread(ch+1,1,4000000,stdin);
int n=strlen(ch+1),i,nr=0,cuv=0,ok=0;
for(i=1;i<=n;i++){
if ((ch[i]>='a' && ch[i]<='z') || (ch[i]>='A' && ch[i]<='Z')){
nr++;
if (ok==0)
cuv++,ok=1;}
else
ok=0;}
printf("%d\n",nr/cuv);
return 0;}