백준 1840 c++

magicdrill·2024년 4월 25일
0

백준 문제풀이

목록 보기
335/655

백준 1840 c++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

string input_string()
{
	string str;

	cin >> str;

	return str;
}

void find_answer(string str)
{
	string left, right;
	int i;
	int A = 0, B = 0;

	left = str.substr(0, str.length() / 2);
	right = str.substr(str.length() / 2, str.length());
	for (i = 0; i < left.length(); i++)
	{
		A += left[i] - '0';
		B += right[i] - '0';
	}
	if (A == B)
	{
		cout << "LUCKY\n";
	}
	else
	{
		cout << "READY\n";
	}

	return;
}

int main(void)
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	string str;

	str = input_string();
	find_answer(str);

	return 0;
}

0개의 댓글