Cod sursa(job #806232)
#include <fstream>
#include <string.h>
using namespace std;
char text[20000000];
int main()
{
ifstream in("text.in"); ofstream out("text.out");
int l = 0, cuv = 0, i;
in.get(text, 2000000);
for (i=0;i<strlen(text);i++)
if ((text[i] >= 'A' && text[i] <= 'Z') || (text[i] >= 'a' && text[i] <= 'z'))
{
l++;
if (i && (text[i-1] < 'A' || text[i-1] > 'Z') && (text[i-1] < 'a' || text[i-1] > 'z'))
cuv++;
}
if ((text[0] >= 'A' && text[0] <= 'Z') || (text[0] >= 'a' && text[0] <= 'z'))
if ((text[1] < 'A' || text[1] > 'Z') && (text[1] < 'a' || text[1] > 'z'))
cuv++;
out<<l/cuv;
}