fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void checkEquation(const string &equation) {
  5. int a = equation[0] - '0';
  6. int b = equation[4] - '0';
  7. int c = equation[8] - '0';
  8.  
  9. if (a + b == c) {
  10. cout << "YES" << endl;
  11. } else {
  12. cout << "NO" << endl;
  13. }
  14. }
  15.  
  16. int main() {
  17. string equation;
  18. cin >> equation;
  19.  
  20. checkEquation(equation);
  21.  
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
NO