Cod sursa(job #906189)

Utilizator bratiefanutBratie Fanut bratiefanut Data 6 martie 2013 16:28:17
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.51 kb
#include <fstream>

using namespace std;

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

long long len,cuv=0;
bool ok;
char s;

int main()
{
    len=0;
    cuv=0;
    ok=false;

    while(f.get(s))
    {
        if((s>='A'&&s<='Z')||(s>='a'&&s<='z'))
        {
            len++;
            if(ok==false)
            cuv++;
            ok=true;
        }
        else
        ok=false;
    }
   // g<<nr<<' '<<cuv<<"\n";
    if(cuv!=0)
    g<<len/cuv;
    else
    g<<len;
    return 0;
}