Pagini recente » Cod sursa (job #1728412) | Cod sursa (job #1782237) | Cod sursa (job #359528) | Cod sursa (job #493833) | Cod sursa (job #2202374)
#include <iostream>
#include <fstream>
using namespace std;
char text[300009];
int nr, nrc;
bool vf;
int main()
{
ifstream fin("text.in");
ofstream fout("text.out");
while (fin >> text)
{
for (int i = 0; i<strlen(text); ++i)
{
if (isalpha(text[i]))
{
nr++;
vf = 1;
}
else
{
if (vf)
{
nrc++;
vf = 0;
}
}
}
if (vf)
{
nrc++;
vf = 0;
}
}
fout << nr / nrc;
}