Cod sursa(job #2110684)

Utilizator constantin.gabrielConstantin Gabriel constantin.gabriel Data 21 ianuarie 2018 10:12:13
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char s;
int sum,nrc,ok;
int main()
{
  while(f.get(s))
  {
      if((s>='a'&& s<='z') || (s>='A' && s<='Z'))
       {
            sum++;
        if(!ok)
        {   ok=1;
            nrc++;
        }

       }
       else ok=0;
  }
    g<<sum/nrc;
}