Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
285 B
1
Indexable
Never
#include <iostream>
using namespace std;

int main()
{
	int n;
	int n1;
	int n2;
	int n3;
	int n4;

	cin >> n;

	n1 = n / 1000;
	n2 = n / 100 % 10;
	n3 = n / 10 % 10;
	n4 = n % 10;

	if (n1 - n4 == n2 + n3) {
		cout << "YES";
	}

	else { 
		cout << "NO";
		}
}