fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int input;
  6. cin >> input;
  7.  
  8. int a = input / 1000, b = input % 10;
  9.  
  10. if (a == b)
  11. cout << a+b << endl;
  12. else cout << "NO" << endl;
  13. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
NO