Cod sursa(job #2402258)

Utilizator IoanMihaiIoan Mihai IoanMihai Data 10 aprilie 2019 15:27:18
Problema Text Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.42 kb
#include<bits/stdc++.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int n,medie,simbol,cuvinte;
string str;
string word;
int main()
{

  while(fin>>str)
  {
  for (int i=0;i<str.size();i++)
   if (isalpha(str[i]))
    {
      simbol++;
      if (i==0)
       cuvinte++;
      else
       if (!isalpha(str[i-1]))
          cuvinte++;
    }
  }
  medie=simbol/cuvinte;
  fout<<medie<<'\n';
  return 0;
}