Cod sursa(job #2596367)

Utilizator laurentiu21Laurentiu Cretu laurentiu21 Data 9 aprilie 2020 17:26:58
Problema Text Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.48 kb
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int n,k;
bool ok;
int main()
{
    char ch;
    while(f.get(ch))
    {
        if ((ch>='a' && ch<='z') || (ch>='A' && ch<='Z'))
        {
            n++;
            ok=true;
        }
        else
            if(ok==true)
            {
                ok=false;
                k++;
            }
    }
    g<<n/k;
    return 0;
}