Cod sursa(job #2071797)

Utilizator tiberiu392Tiberiu Ungurianu tiberiu392 Data 21 noiembrie 2017 00:11:30
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.42 kb
#include <fstream>

using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char cuv,c;
int lng,ok,nr=0,nr2=0,k=0;
int main()
{

    while(f.get(c))
       if((c>='a' && c<='z') || (c>='A' && c<='Z'))
        {
            lng++;
            ok=1;
        }
        else
            if(ok)
                nr++,ok=0;
    if(nr==0)
    {
        g<<0;
        return 0;
    }
    g<<lng/nr;

}