코딩테스트/백준

[브1] 1356 - 유진수

ShovelingLife 2024. 12. 10. 18:50
#include <iostream>
#include <string>
using namespace std;

int main() 
{
	string N; cin >> N;
	int tempLeft = 1;

	for (int i = 0; i < N.length() - 1; i++) 
	{
		int tempRight = 1;
		tempLeft *= (N[i] - '0');

		for (int k = i + 1; k < N.length(); k++) 
			tempRight *= (N[k] - '0');
		
		if (tempLeft == tempRight) 
		{
			cout << "YES";
			return 0;
		}
	}
	cout << "NO";
}