[c++] 백준 1476

알감자·2022년 5월 2일
0

백준알고리즘

목록 보기
29/52
#include <iostream>
using namespace std;

int main() 
{
	int E, S, M;
	int result, year = 1;
	cin >> E >> S >> M;

	while (1)
	{
		if ((year-E) % 15 == 0 && (year-S) % 28 == 0 && (year-M) % 19 == 0)
		{
			result = year;
			break;
		}
		else
			year++;
	}

	cout << result;
	return 0;
}

0개의 댓글