Untitled
Anonymous
c_cpp
10/17/2023 4:22 PM
380 B
16
Indexable
#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";
}
}Editor is loading...