Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
282 B
1
Indexable
Never
#include <iostream>
using namespace std;
int main()
{
	int N;
	cin >> N;

	int a, b;
	a = N / 1000;
	b = N % 1000;
	int S1, S2;
	S1 = a % 10 + (a / 10) % 10 + a / 100;
	S2 = a % 10 + (a / 10) % 10 + a / 100;

	if (S1 == S2) 
		cout << "YES";

	else cout << "NO";
}