fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. string s;
  8. int i,n,k1,k2;
  9. while(cin >> s)
  10. {
  11. k1=k2=0,n=s.size();
  12. for(i=0;i<n;i++)
  13. {
  14. if(s[i]=='x') k1++;
  15. else if(s[i]=='y') k2++;
  16. }
  17. k1==k2?cout<<"True\n":cout<<"False\n";
  18. }
  19.  
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 4476KB
stdin
"aaxbby"
"aaxbb"
"bbbaxyb"
"jjjxjjjy"
"fefsegesxy"
"xydawdhafw"
"aaaaaxxxxxx"
"xaxwdawyx"
stdout
True
False
True
True
True
True
False
False