///
Search

3์ฐจ์› ๋ฆฌ์ŠคํŠธ ์ž…๋ ฅ๋ฐ›๊ธฐ

๋ถ„๋ฅ˜
๋ฌธ๋ฒ•
์†์„ฑ
์ƒ์„ฑ์ผ
2022/02/04 22:50
์ตœ์ข… ์ˆ˜์ •
2022/02/04 23:16
arr[๋†’์ด][ํ–‰][์—ด]
# 3์ฐจ์›๋ฆฌ์ŠคํŠธ ์ž…๋ ฅ๋ฐ›์•„์„œ ๋งŒ๋“ค๊ธฐ # ๋ฐฉ๋ฒ•1 : ๋นˆ ๋ฐฐ์—ด์— 2์ฐจ์›๋ฆฌ์ŠคํŠธ ๋„ฃ๊ธฐ h, row, col = map(int, input().split()) arr = [] for i in range(h): temp = [] for j in range(row): temp.append(list(map(int, input().split()))) arr.append(temp) # ์ด์ฐจ์›๋ฆฌ์ŠคํŠธ append print(arr) # ๋ฐฉ๋ฒ•2 : ๋ฆฌ์ŠคํŠธ ์ปดํ”„๋ฆฌํ—จ์…˜์œผ๋กœ ์ด์ฐจ์›๋ฆฌ์ŠคํŠธ ๋งŒ๋“ค๊ณ  ์ธ๋ฑ์Šค๋กœ ์ด์ฐจ์›๋ฆฌ์ŠคํŠธ ๋„ฃ์–ด์ฃผ๊ธฐ h, row, col = map(int, input().split()) arr = [[] for _ in range(h)] for i in range(h): arr[i] = [list(map(int, input().split())) for _ in range(row)] print(arr) # ๋ฐฉ๋ฒ•3 : ๋ฆฌ์ŠคํŠธ ์ปดํ”„๋ฆฌํ—จ์…˜๋งŒ์œผ๋กœ 3์ฐจ์›๋ฆฌ์ŠคํŠธ ๋งŒ๋“ค๊ธฐ h, row, col = map(int, input().split()) arr = [[list(map(int, input().split())) for _ in range(row)] for _ in range(h)] print(arr) """ ๋†’์ด2,ํ–‰3,์—ด4 [input] 2 3 4 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 [output] [ [ [1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12] ], [ [13, 14, 15, 16], [17, 18, 19, 20], [21, 22, 23, 24] ] ] """
Python
๋ณต์‚ฌ