Cod sursa(job #2123621)

Utilizator AndreiG23Ghiurcuta Andrei AndreiG23 Data 6 februarie 2018 14:13:37
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.42 kb
#include <iostream>
#include <fstream>
#include <cstring>

using namespace std;

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


int k,S;
bool ok;
char s;
int main()
{

  while(fin.get(s))
  {
      if((s>='a'&& s<='z') || (s>='A' && s<='Z'))
       {
            S++;
        if(!ok)
        {   ok=1;
            k++;
        }

       }
       else ok=0;
  }
fout<<S/k;


    return 0;
}