Cod sursa(job #1781346)

Utilizator luci2000lup lucia luci2000 Data 16 octombrie 2016 20:10:33
Problema Text Scor 100
Compilator cpp Status done
Runda simulare_emag_mediu_2016_runda1 Marime 0.44 kb
#include <iostream>
#include <fstream>

using namespace std;

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

char k;
int cl,cc,ok;
int main()
{
    while(fin.get(k))
    {
        if((k>='A' && k<='Z') || (k>='a' && k<='z'))
            cl++, ok=1;
        else
        {
            if(ok==1)
                cc++;
            ok=0;
        }
    }
    fout<<cl/cc;
    fin.close();
    fout.close();
    return 0;
}