Cod sursa(job #2397432)

Utilizator robertrRotaru Stefan Robert robertr Data 4 aprilie 2019 13:26:32
Problema Text Scor 40
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.5 kb
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
long long nr,nrc,l;
char x;
bool ok;
int main()
{
    x=f.get();
    l=0;
    while(x!='\n')
    {
        if((x<='z'&&x>='a')||(x<='Z'&&x>='A'))
        {
            if(!ok)
                nrc++;
            nr++;
            ok=1;
        }
        else
        {
            ok=0;
        }
        x=f.get();
    }
    if(nrc)
        g<<nr/nrc<<'\n';
    else g<<0;
    return 0;
}