Cod sursa(job #2609161)

Utilizator XXMihaiXX969Gherghinescu Mihai Andrei XXMihaiXX969 Data 2 mai 2020 11:42:25
Problema Text Scor 40
Compilator cpp-64 Status done
Runda igorj_mentorat1 Marime 0.59 kb
#include <bits/stdc++.h>

using namespace std;

const int DIM =1e9;

char s[DIM];

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

int main()
{
    in.get(s,DIM);


    int cnt = 0;
    int nrl = 0;
    bool ok = false;

    for(int i = 0; i < strlen(s); i++)
    {
        if((s[i] >= 'a' && s[i] <= 'z') || (s[i] >= 'A' && s[i] <= 'Z'))
        {
            nrl++;
            if(ok == false)
            {
                ok = true;
                cnt++;
            }
        }
        else
        ok = false;
    }

    out << nrl / cnt;
    return 0;
}