題目本身有問題而已
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
char yee[100000];
while(cin>>yee)
{
int sum=0,y=0;
for(int i=0;yee[i]!=0;i++)
{
if(yee[i]=='y')
{
sum+=abs(i-y);
y+=3;
}
}
cout<<sum<<endl;
}
return 0;
}