Cod sursa(job #2450027)

Utilizator Dragos1226Dragos Chileban Dragos1226 Data 21 august 2019 16:44:34
Problema Text Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.47 kb
#include<bits/stdc++.h>

using namespace std;
ifstream in("text.in");
ofstream out("text.out");
char c;
int nrcuv,lung;
bool ok = true;

bool is_letter (char c) {
   if(('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z'))
      return 1;
   return 0;
}

int main() {

   while(in.get(c)) {
      if (is_letter(c)) {
         if(ok)
            nrcuv++;
         ok = false;
         lung++;
      }
      else  ok = true;
   }

   out << lung/nrcuv;


}