Cod sursa(job #2765687)
Utilizator | Data | 29 iulie 2021 16:41:00 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.55 kb |
#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main () {
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
long long int c,cuv=1,lit=1;
c=0;
char a;
while(scanf("%c",&a)!=EOF) {
if(isalpha(a)>=1) {
lit++;
if(c==0) {
cuv++;
c=1;
}
} else {
c=0;
}
}
if(c==0 && isalpha(a)!=0)
cuv++;
printf("%lld\n",(lit-1)/(cuv-1));
return 0;
}