백준 2163 c++

magicdrill·2024년 4월 6일
0

백준 문제풀이

목록 보기
262/654

백준 2163 c++

#include <iostream>

using namespace std;

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

	int N, M, i = 0, j = 0;
	int count = 0;
	int temp = 0;

	cin >> N >> M;
	while (1)
	{
		if (N == 1)
		{
			break;
		}
		N = N - 1;
		i++;
	}
	while (1)
	{
		if (M == 1)
		{
			break;
		}
		M = M - 1;
		j++;
	}
	count = i + (i + 1) * j;
	cout << count << "\n";

	return 0;
}

0개의 댓글