๐Ÿ•ธ Algorithm/๐Ÿ•ธ ๋ฐฑ์ค€ BaekJoon

[๋ฐฑ์ค€][java][11654][์•„์Šคํ‚ค ์ฝ”๋“œ]

๋‰ด์ด NUEY 2024. 1. 26. 22:33
๋ฐ˜์‘ํ˜•

import java.util.Scanner;

// 11654	์•„์Šคํ‚ค ์ฝ”๋“œ
public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);

		String str = in.next();
		
		int asc = str.charAt(0);
		
		in.close();
		
		System.out.print(asc);
	}
}
  • char๋ฅผ int๋กœ ๋ณ€ํ™˜ํ•˜๋ฉด ์•„์Šคํ‚ค์ฝ”๋“œ๊ฐ€ ๋‚˜์˜ต๋‹ˆ๋‹ค.
๋ฐ˜์‘ํ˜•