본문 바로가기
  • Let's study
PS/Baekjoon

[백준] 20336: Haughty Cuisine(C++)

by 코딩고수이고파 2025. 9. 23.

문제

https://www.acmicpc.net/problem/20336

풀이

입력 받은 n개의 세트 메뉴 중에 아무거나 출력하면 되므로, 그냥 첫 번째 세트 메뉴의 개수와 메뉴를 출력하면 된다.

코드

#include <iostream>
#include <string>

using namespace std;

int main() {
	int n, m;
	string str;
	
	cin>>n>>m;
		
	cout<<m<<'\n';
	
	for(int i=0;i<m;i++){
		cin>>str;
		cout<<str<<'\n';
	}
	
	return 0;
}

댓글