Cod sursa(job #2274137)

Utilizator V3ctorZStefan Nacuta V3ctorZ Data 1 noiembrie 2018 14:11:08
Problema Text Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.38 kb
#include <iostream>
#include <fstream>

using namespace std;

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

int no, words;
char c;

int main()
{
  while(in.get(c)) {
    if(isalpha(c)) {
      words++;
      while (isalpha(c)) {
        no++;
        in.get(c);
      }
    }
  }

  out << no / words << '\n';

  in.close();
  out.close();
  return 0;
}