Pagini recente » Cod sursa (job #411679) | Cod sursa (job #383858) | Cod sursa (job #493545) | Cod sursa (job #3289881) | Cod sursa (job #1739319)
#include <fstream>
#include <cstring>
#include <cassert>
using namespace std;
const int LEN = 2000000;
ifstream fin("text.in");
ofstream fout("text.out");
char a[LEN];
int n, x, y;
bool Litera(char p)
{
return ((p >= 'A' and p <= 'Z') or (p >= 'a' and p <= 'z'));
}
int main()
{
fin.getline(a, LEN);
n = strlen(a);
assert(n > 0 && n <= 1100000);
for (int i = 0; i < n; i++) {
if (Litera(a[i]))
{
x++;
if (not Litera(a[i + 1]))
y++;
}
}
fout << x / y << '\n';
return 0;
}