Cod sursa(job #2765686)

Utilizator raica_cristiraica dumitru cristian raica_cristi Data 29 iulie 2021 16:40:30
Problema Text Scor 60
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.54 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)/(cuv));   
    return 0;   
}