Cod sursa(job #1681525)

Utilizator darisavuSavu Daria darisavu Data 9 aprilie 2016 15:45:27
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include <fstream>

using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
    char c;
    int ok=0,l=0,cv=0;
    while(f.get(c))
    {
        if((c>='A'&&c<='Z')||(c>='a'&&c<='z'))
           {
               l++;
               ok=1;
           }
           else
            {
                if(ok==1) cv++;
                ok=0;
            }
    }
    g<<l/cv;

    return 0;
}