Cod sursa(job #1828770)

Utilizator pistvanPeter Istvan pistvan Data 13 decembrie 2016 20:59:51
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.44 kb
#include <fstream>

using namespace std;

int main()
{
    int hossz=0, db=0, k=0;
    char c;
    ifstream f("text.in");
    while (!f.eof())
    {
        f.get(c);
        if (isalpha(c))
        {
            hossz++;
            if (k==0)
            {
                k=1;
                db++;
            }
        }
        else k=0;
    }
    f.close();
    ofstream g("text.out");
    g<<hossz/db;
    g.close();
}