Pagini recente » Cod sursa (job #36274) | Cod sursa (job #465993) | Cod sursa (job #1725260) | Cod sursa (job #90587) | Cod sursa (job #2368057)
#include <fstream>
#include <cstring>
#define nmax 1000004
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int n,tl,w;
char s[nmax];
bool ok;
int main()
{
f.getline(s,1000001);
n=strlen(s);
for (int i=0;i<n;i++)
{
ok=0;
while ((s[i]>='a' && s[i]<='z') || (s[i]>='A' && s[i]<='Z'))
{
ok=1;
tl++;
i++;
}
if (ok==1)
{
w++;
i--;
}
}
g<<tl/w;
f.close();
g.close();
return 0;
}