Pagini recente » Istoria paginii runda/2014oni10/clasament | Cod sursa (job #1867151) | Cod sursa (job #636679) | Cod sursa (job #966698) | Cod sursa (job #2476280)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char x[1048576 + 6];
long long s, contor, c;
int main()
{
fin.getline(x, 1048576 + 3);
for (int i = 0; i < strlen(x); ++i)
{
if ((x[i] >= 'a' && x[i] <= 'z') || (x[i] >= 'A' && x[i] <= 'Z'))
{
++contor;
}
else
{
if (contor > 0)
{
s = 1LL * s + contor;
contor = 0;
c = 1LL * c + 1;
}
}
}
if (contor > 0)
{
s = 1LL * s + contor;
contor = 0;
c = 1LL * c + 1;
}
if (c == 0)
{
fout << 0;
return 0;
}
fout << 1LL * s / c;
fin.close();
fout.close();
return 0;
}