Pagini recente » Cod sursa (job #1118589) | Cod sursa (job #2322581) | Cod sursa (job #2771926) | Rating Stroe Mariana Geanina (Geanina17) | Cod sursa (job #2718038)
#include <bits/stdc++.h>
using namespace std;
ifstream fin ("text.in");
ofstream fout("text.out");
int main()
{
char c;
int ok = 0, S = 0;
int nrcuv = 0, nrl = 0;
while(fin.get(c))
{
if ( ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z'))
nrl++;
else
{
if(nrl > 0)
nrcuv++;
S = S + nrl;
nrl = 0;
}
}
fout << S / nrcuv ;
fout.close();
return 0;
}