Pagini recente » Cod sursa (job #1753318) | Cod sursa (job #2887757) | Cod sursa (job #596939) | Cod sursa (job #1954368) | Cod sursa (job #2476296)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
string x;
long long s, c, v;
int main()
{
while (fin >> x)
{
v = 0;
for (int j = 0; j < x.size(); ++j)
{
if ((x[j] >= 'a' && x[j] <= 'z') || (x[j] >= 'A' && x[j] <= 'Z'))
{
++s;
v = 1;
}
else
{
if (v)
{
v = 0;
++c;
}
}
}
if (v)
++c;
}
if (c == 0)
{
fout << 0;
return 0;
}
fout << s / c;
fin.close();
fout.close();
return 0;
}