Cod sursa(job #1673478)

Utilizator dragos000Cojanu Dragos dragos000 Data 3 aprilie 2016 20:50:39
Problema Text Scor 50
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.42 kb
#include <iostream>
#include <fstream>

using namespace std;

int main()
{
    ifstream f("text.in");
    char x;
    int cuv=1,l=0;
    bool ok;
    while(f.get(x))
    {
        if(x>='A'&&x<='Z' || x>='a'&& x<='z')
     {
         l++;
         ok=1;

     }else
     {
         if(ok)cuv++;
         ok=0;
     }
    }



    ofstream g("text.out");
    g<<l/cuv;
    g.close();
    return 0;
}