본문 바로가기
알고리즘 & 자료구조/백준

백준 2183

by 신재권 2021. 11. 19.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;


public class Main2183 {

	public static int N;
	
	public static void main(String[] args) throws IOException {
		 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		 StringTokenizer st = new StringTokenizer(br.readLine());
		 N = Integer.parseInt(st.nextToken());	//인원 수 N
		 StringBuilder sb = new StringBuilder();
		 sb.append(st.nextToken());
		 //승리 조건을 만족하면 게임 종료 
		 //-> 마지막 게임 승리자가 최종승자
		 System.out.println(sb.charAt(sb.length()-1));

	}
	
	

}

'알고리즘 & 자료구조 > 백준' 카테고리의 다른 글

백준 2546  (0) 2021.11.21
백준 2520  (0) 2021.11.20
백준2154  (0) 2021.11.18
백준 1703  (0) 2021.11.17
백준 1333  (0) 2021.11.16