Cod sursa(job #1288096)

Utilizator RaduToporanRadu Toporan RaduToporan Data 8 decembrie 2014 16:24:42
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.47 kb
#include <fstream>

using namespace std;

ifstream fin("text.in");
ofstream fout("text.out");

char x;
int cv,li;
bool ok;

int main()
{
    while(fin.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;}
        }
    }
    fout<<li/cv<<endl;
    fin.close();
    fout.close();
    return 0;
}