Cod sursa(job #1844186)

Utilizator isav_costinVlad Costin Andrei isav_costin Data 9 ianuarie 2017 19:57:35
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.61 kb
#include <cstdio>
#include <algorithm>

int a[1001], b[1001];

using namespace std;

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

    int l=0, ok=0, cuv=0;
    char c;

    c=fgetc(stdin);

    while( c!=EOF )
    {

        if( ('a'<=c && c<='z') || ('A'<=c && c<='Z') )
        {
            l++;

            if( ok==0 )
                cuv++;

            ok=1;
        }
        else
            ok=0;

        c=fgetc(stdin);
    }

    if( cuv==0 )
        printf( "0" );
    else
        printf( "%d", l/cuv );

    return 0;
}