fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <algorithm>
  4. #include <cstdlib>
  5. #include <cctype>
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.  
  11. string s1("xy");
  12. string s2("yy");
  13.  
  14. int a = 0; //counts
  15. int b = 0;
  16.  
  17. for(int i = 0; i < s1.length(); i++)
  18. if(isalnum(s1.at(i)))
  19. a += tolower(s1.at(i));
  20. for(int i = 0; i < s2.length(); i++)
  21. if(isalnum(s2.at(i)))
  22. b += tolower(s2.at(i));
  23.  
  24. cout<<boolalpha<<(a == b)<<endl<<endl;
  25.  
  26. return 0;
  27. }
Success #stdin #stdout 0s 2860KB
stdin
Standard input is empty
stdout
false