๋์ ์ฝ๋
def x(a,b):
if b==0:
return 1
else:
return a*x(a,b-1)
for _ in range(1, 11):
t = int(input())
a,b = map(int,input().split())
print("#"+str(t) , x(a,b) )
์ฌ๊ท๋ฅผ ์ด์ฉํด์ ๊ฑฐ๋ญ์ ๊ณฑ์ ๊ณ์ฐ
for _ in range(1, 11):
t = int(input())
a,b = map(int,input().split())
print("#"+str(t) , a**b )
์ฌ๊ท๋ฅผ ์ด์ฉํ์ง ์๋๋ค๋ฉด ์์ฒญ ๊ฐ๋จํ ๋ฌธ์
'Algorithm > SWEA' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[SWEA - D3] 1216. ํ๋ฌธ2 (0) | 2023.05.01 |
---|---|
[SWEA - D3] 1215. ํ๋ฌธ1 (0) | 2023.05.01 |
[SWEA - D3] 4406. ๋ชจ์์ด ๋ณด์ด์ง ์๋ ์ฌ๋ (0) | 2023.04.20 |
[SWEA - D3] 1206. View (0) | 2023.04.20 |
[SWEA - D2] 1984. ์ค๊ฐ ํ๊ท ๊ฐ ๊ตฌํ๊ธฐ (0) | 2023.04.18 |