Untitled
twqtunknown
c_cpp
2 years ago
509 B
9
Indexable
#include <iostream>
#include <string>
using namespace std;
int main()
{
int N;
cin >> N;
int firstCH = 0;
int secondCH = 0;
int therdCH = 0;
int forthCH = 0;
if (chuslo >= 1000 and N <= 9999) {
firstCH = N / 1000;
secondCH = (N / 100) % 10;
therdCH = (N / 10) % 10;
forthCH = N % 10;
}
if (firstCH - forthCH == secondCH + therdCH) {
cout << "YES";
}
else {
cout << "NO";
}
}
Editor is loading...