Cod sursa(job #2609692)

Utilizator PatriciaCretoiuCretoiu Patricia PatriciaCretoiu Data 3 mai 2020 01:42:10
Problema Text Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.54 kb
#include <bits/stdc++.h>

using namespace std;
ifstream in("text.in");
ofstream out("text.out");

int found, letters, words;

int main()
{
    ios_base::sync_with_stdio(false);
    in.tie(nullptr);

    char c;

    while(in.get(c))
    {
        if(isalpha(c) != 0 && found == 0)
        {
            found = 1;
            letters++;
            words++;
        }
        else if(isalpha(c) != 0)
            letters++;
        else
            found = 0;
    }

    out << letters / words << '\n';

    return 0;
}