Pagini recente » Cod sursa (job #1617694) | Cod sursa (job #1535639) | Cod sursa (job #540074) | Cod sursa (job #2647244) | Cod sursa (job #2757129)
#include <bits/stdc++.h>
#define FILES freopen("text.in","r",stdin);\
freopen("text.out","w",stdout);
#define fastio std::ios_base::sync_with_stdio(NULL),cin.tie(NULL),cout.tie(NULL);
using namespace std;
char c;
int lgcv,cv;
bool ok;
string a;
bool gd(char c)
{
return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
}
int main()
{
fastio
FILES
getline(cin,a);
for(int i = 0;i<a.size();++i)
{
if(gd(a[i]))
{
while(i < a.size() && (gd(a[i]) || a[i] != ' '))
{
if(gd(a[i])) lgcv++;
if(a[i] == '-') cv++;
i++;
}
cv++;
}
}
cout << lgcv/cv;
}