Cod sursa(job #1311832)

Utilizator gedicaAlpaca Gedit gedica Data 8 ianuarie 2015 17:14:25
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.47 kb
#include<fstream>

using namespace std;

ifstream in( "text.in" );
ofstream out( "text.out" );

int lung, cuv;
char c;
bool ok=0;

int main()
{
    in.get(c);

    while( !in.eof() )
    {
        if((c>='a' && c<='z')||(c>='A' &&c<='Z'))
        {
            ++lung;
            ++ok;
        }
        else if( ok )
        {
            ++cuv;
            ok= 0;
        }
        in.get( c );
    }

    out << lung/cuv <<'\n';

    return 0;
}