Pagini recente » Cod sursa (job #1187275) | Cod sursa (job #738182) | Profil Aly-Alexandru | Cod sursa (job #1300444) | Cod sursa (job #1825073)
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
char a;
long s=0,z=0;
f.get(a);
if((a>='a'&&a<='z')||(a>='A'&&a<='Z'))
s++;
while(!f.eof())
{
char b;
f.get(b);
if((b>='a'&&b<='z')||(b>='A'&&b<='Z'))
{
if(!((a>='a'&&a<='z')||(a>='A'&&a<='Z')))
z++;
s++;
}
a=b;
}
g<<s/z;
return 0;
}