Cod sursa(job #2450775)

Utilizator ProBatmanBalint Leonard ProBatman Data 24 august 2019 16:04:04
Problema Text Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.54 kb
#include <bits/stdc++.h>

using namespace std;

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

long long lc = 0, nc = 0 , k = 0;
char c;
bool ok = 0;

void citire()
{
    while(fin.get(c))
    {
        if(c>='A'&&c<='z')
        {
            ok = 1;
            lc++;
        }
        else if(ok==1)
        {
            ok = 0;
            nc++;
        }
    }
}

void afisare()
{
    fout << lc << " " << nc << '\n';
    fout << lc/nc;
}

int main()
{
    citire();
    afisare();
    return 0;
}