Untitled

twqt
mail@pastecode.io avatar
unknown
c_cpp
a year ago
509 B
0
Indexable
Never
#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";
    }


}