Cod sursa(job #2406479)

Utilizator Simon2712Simon Slanina Simon2712 Data 15 aprilie 2019 19:37:09
Problema Text Scor 40
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.52 kb
#include <cstdio>
using namespace std;

int main()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    char c;
    int nrcuv=0,incuv=0,nrch=0,pp=1;
    while(pp)
    {
      c=getchar();
      if((c>='a' && c<='z') || (c>='A' && c<='Z'))
      {
        if(incuv==0)
        {
          nrcuv++;
          incuv=1;
        }
        nrch++;
      }
      else{
        incuv=0;
        if(c==EOF || c=='\n')
          pp=0;
      }
    }
    printf("%d",nrch/nrcuv);
    return 0;
}