Untitled
heuser_0563559
c_cpp
a year ago
528 B
1
Indexable
#include <iostream> using namespace std; int main() { int chuslo; cin >> chuslo; int firstCH = 0; int secondCH = 0; int therdCH = 0; int forthCH = 0; if (chuslo >= 1000 and chuslo <= 9999) { firstCH = chuslo / 1000; secondCH = (chuslo / 100) % 10; therdCH = (chuslo / 10) % 10; forthCH = chuslo % 10; } ; if (firstCH - forthCH == secondCH + therdCH) { cout << "YES"; } else { cout << "NO"; } }
Editor is loading...