Untitled

EWTWE
mail@pastecode.io avatar
unknown
c_cpp
7 months ago
690 B
0
Indexable
Never
#include <iostream>
#include <string>
using namespace std;

int main()
{
    int A, B;
    cin >> A >> B;
    if (A % 2 == 0 and A > 0 and A > -100 and A < 100 and B % 2 != 0 and B < 0 and B > -100 and B < 100) {
        cout << A - B;
    }
    if (A % 2 != 0 and A < 0 and A > -100 and A < 100 and B % 2 == 0 and B > 0 and B > -100 and B < 100) {
        cout << B - A;
    }
    if ((A % 2 != 0 and B % 2 != 0) or (A % 2 == 0 and B % 2 == 0) or (A > 0 and B > 0) or (A < 0 and B < 0) or (A < -100 or A > 100) or (B < -100 or B > 100) or (A % 2 == 0 and A < 0) or (A % 2 != 0 and A > 0) or (B % 2 == 0 and B < 0) or (B % 2 != 0 and B > 0)) {
        cout << "NO";
    }
}