Cod sursa(job #2765683)

Utilizator raica_cristiraica dumitru cristian raica_cristi Data 29 iulie 2021 16:31:48
Problema Text Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.59 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 {
            if (c != 0) {
                cuv++;
            }
            c=0;   
        }
    }
    if (c != 0) {
        cuv++;
    }
    printf("%lld\n",(lit-1)/(cuv-1));   
    return 0;   
}