Cod sursa(job #2335061)

Utilizator Andrei-27Arhire Andrei Andrei-27 Data 3 februarie 2019 16:09:27
Problema Text Scor 10
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.46 kb
#include <bits/stdc++.h>
#define pb push_back
using namespace std ;
ifstream in ("text.in") ;
ofstream out ("text.out") ;

int newword , nralpha , nrword ;

int main ()
{
    char c ;
    while ( in >> c )
    {
        if ( isalpha( c ) )
        {
            nralpha ++ ;
            if ( newword == 0 )
                newword = 1 , nrword ++ ;
        }
        else    newword = 0 ;
    }
    out << nralpha / nrword ;
    return 0 ;
}