Cod sursa(job #2703371)

Utilizator stefantagaTaga Stefan stefantaga Data 8 februarie 2021 14:10:41
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 f("text.in");
ofstream g("text.out");
long long lung,nr,sum;
char c;
int main()
{
    while (f.get(c))
    {
        if (('a'<=c&&c<='z')||('A'<=c&&c<='Z'))
         {
             lung++;
         }
         else
         {
             if (lung!=0)
             {
                 nr++;
             }
             sum+=lung;
             lung=0;
         }
    }
    g<<sum/nr;
    return 0;
}