Cod sursa(job #2082273)

Utilizator MasterOfLoreBogdan Surdu MasterOfLore Data 5 decembrie 2017 21:40:30
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.44 kb
#include <iostream>
#include <fstream>
#include <cstring>
#include <cctype>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char s;
int n_lit, n_cuv;
bool ok;
int main()
{
  while(f.get(s))
  {
      if(isalpha(s))
      {
          n_lit++;
          if(!(ok))
          {
              n_cuv++;
              ok=1;
          }
      }
      else ok=0;
  }
  if(n_cuv) g << n_lit/n_cuv;
  else g << 0;
}