Cod sursa(job #868417)

Utilizator AlexandruValeanuAlexandru Valeanu AlexandruValeanu Data 30 ianuarie 2013 23:42:12
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.53 kb
#include <iostream>
#include <cstdio>

using namespace std;

int litere, cuvinte;
bool verif;
char c;

void rezolva(){

    freopen("text.in", "r", stdin);
    freopen("text.out", "w", stdout);

    scanf("%c", &c);

    while( !feof( stdin ) ){

        if(isalpha(c))
            litere++,
            verif = true;
        else
            if(verif)
                verif = false,
                cuvinte++;

        scanf("%c", &c);
    }

    printf("%d\n", litere / cuvinte);
}


int main(){

    rezolva();

    return 0;
}