#include <iostream>
using namespace std;
int main() {
string str;
cin >> str;
int x = 0, y = 0, i;
if(21 > str.size()) {
for (i = 0; i < str.size(); i++) {
if (str[i] == 'o') {
y++;
}
else if (str[i] == 'z') {
x++;
}
}
if (y == 2 * x) {
printf("Yes");
}
else {
printf("No");
}
}
return 0;
}
Problem
You are required to enter a word that consists of and that denote the number of Zs and Os respectively. The input word is considered similar to word zoo if 2 * x = y .
Determine if the entered word is similar to word zoo.
For example, words such as zzoooo and zzzoooooo are similar to word zoo but not the words such as zzooo and zzzooooo.
Input format
- First line: A word that starts with several Zs and continues by several Os.
Note: The maximum length of this word must be 20 .
Output format
Print Yes if the input word can be considered as the string zoo otherwise, print No.