Cod sursa(job #1422836)

Utilizator oldatlantianSerban Cercelescu oldatlantian Data 19 aprilie 2015 22:16:47
Problema Text Scor 90
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.44 kb
#include <cctype>
#include <cstdio>
using namespace std;

int main(void){
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    int n,l;
    char a,b;
    n=0;
    l=1;
    scanf("%c",&a);
    while(scanf("%c",&b)!=EOF){
        if(isalpha(a) && !isalpha(b))
            ++n;
        if(isalpha(a))
            ++l;
        a=b;
    }
    if(isalpha(a))
        ++n,++l;
    printf("%d",l/n);
    return 0;
}