Cod sursa(job #1283586)

Utilizator paul_filip98Paul Filip paul_filip98 Data 5 decembrie 2014 20:52:50
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.57 kb
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char x;
int cv,li;
bool ok;
int main()
{
    while(f.get(x))
    {
        if(ok==false)
        {
            if((x>='a'&&x<='z')||(x>='A'&&x<='Z'))
               ok = true;
        }
        if(ok == true)
        {
          if((x>='a'&&x<='z')||(x>='A'&&x<='Z'))
          li++;
          else
          {
              cv++;
              ok=0;
          }
        }
    }
    g<<li/cv<<'\n';
    f.close();
    g.close();
    return 0;
}