Pagini recente » Cod sursa (job #2323828) | Cod sursa (job #2192868) | Cod sursa (job #298884) | Cod sursa (job #7189) | Cod sursa (job #2022687)
#include <fstream>
#include <cstring>
using namespace std;
ifstream cin("text.in");
ofstream cout("text.out");
bool f(char ch)
{
if('a'<=ch and ch<='z')
return 1;
if('A'<=ch and ch<='Z')
return 1;
return 0;
}
int main()
{
ios_base::sync_with_stdio(0);
char s[1100005];
int sum=0,nr=0;
while(cin.getline(s,1100000))
{
int n=strlen(s);
for(int i=0;i<n;i++)
{
if(f(s[i]))
{
nr++;
while(f(s[i]))
{
sum++;
i++;
}
}
}
}
cout<<sum/nr;
return 0;
}