Untitled

Anonymous
plain_text
10/16/2022 2:12 PM
376 B
17
Indexable
#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";
}
Editor is loading...