Untitled
user_0563559
c_cpp
2 years ago
362 B
12
Indexable
#include <iostream>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
int a, l;
cin >> a >> l;
if (a % 2 == 0 and l % 2 != 0) {
cout << a - l;
}
if (a % 2 != 0 and l % 2 == 0) {
cout << l - a;
}
if (a % 2 != 0 and l % 2 != 0) {
cout << "NO";
}
else if (a > 0 and l > 0) {
cout << "NO";
}
}Editor is loading...