Untitled
#include <iostream> using namespace std; int main() { int a, b, c, d, f, g; cin >> a; b = a / 1000; c = a / 100 % 10; d = a / 10 % 10; f = a % 10; if (b - f==c + d) { cout << "YES"; } else { cout << "No"; } }
#include <iostream> using namespace std; int main() { int a, b, c, d, f, g; cin >> a; b = a / 1000; c = a / 100 % 10; d = a / 10 % 10; f = a % 10; if (b - f==c + d) { cout << "YES"; } else { cout << "No"; } }