Banner

My Tech Blog (nํŒฉํ† ๋ฆฌ์–ผ)

โœ… ๋ฌธ์ œ1๋ณด๋‹ค ํฐ ์ •์ˆ˜(N)์„ ์ž…๋ ฅํ•˜๋ฉฐ N!๊ฐ’์„ ๊ตฌํ•˜์‹œ์˜ค.*ํŒฉํ† ๋ฆฌ์–ผ์ด๋ž€ N์˜ ์ˆ˜๋ณด๋‹ค ์ž‘๊ฑฐ๋‚˜ ๊ฐ™์€ ๋ชจ๋“  ์–‘์˜ ์ •์ˆ˜์˜ ๊ณฑex) 3! = 1 x 2 x 3 => 6โœ… ์ฝ”๋“œpublic class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("์ž…๋ ฅ : "); int n = sc.nextInt(); // ๋ณ€์ˆ˜ ์ดˆ๊ธฐํ™” int factorial = 1; // n๋ถ€ํ„ฐ 1๊นŒ์ง€์˜ ๋ชจ๋“  ์–‘์˜ ์ •์ˆ˜๋ฅผ ๊ณฑํ•จ for (int i = 1; i  โœ… ์ถ”๋ก ๊ณผ์ •int factorial = 1;: ํŒฉํ† ๋ฆฌ์–ผ ๊ฐ’์„ ..
์ธ์ ˆ๋ฏธ์˜€๋˜๊ฒƒ
'nํŒฉํ† ๋ฆฌ์–ผ' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก
์ƒ๋‹จ์œผ๋กœ