MapleStory Finger Point

๐Ÿƒ‍โ™‚๏ธBaekjoon/Python

#2720 - python

HYEJU01 2024. 5. 1. 17:46

 

 ๐Ÿ’ก ์ฝ”๋“œ

t = int(input()) #ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค๋งŒํผ ๋Œ๋ ค์ค€๋‹ค.

for _ in range(t): 
	money = int(input()) #๊ฑฐ์Šค๋ฆ„๋ˆ์„ ํ•˜๋‚˜ ๋ฐ›์•„์ฃผ๊ณ 
	for i in [25, 10, 5, 1]: #๋ฆฌ์ŠคํŠธ๊ฐ’ 4๊ฐœ ํ•˜๋‚˜์”ฉ ๋Œ๋ ค์ค€๋‹ค.
		print(money//i, end=' ')  #๊ฑฐ์Šค๋ฆ„๋ˆ // i => ๋™์ „ ๊ฐœ์ˆ˜
		money = money%i # ๋‹ค์Œ ๊ฐ’์€ money % i  ์˜ ๋‚˜๋จธ์ง€ ๊ฐ’์ด ๋˜์–ด์•ผํ•จ

 


 

 

 

 ๐Ÿ’ก์•Œ๊ณ ๋ฆฌ์ฆ˜ ๋ถ„์„ !!

T = (int(input()))

ํ…Œ์ŠคํŠธ ๊ฐœ์ˆ˜ ๊ฐ€์ ธ์˜ค๊ธฐ

 

for i in range (T):
    a = input()
    aa.append(a)

๊ฐœ์ˆ˜๋งŒํผ ๊ฑฐ์Šค๋ฆ„๋ˆ ๋ฐ›์•„์˜ค๊ธฐ

 

coin_types = [25,10,5,1]

๋‹จ์œ„๊ฐ€ ์„ผํŠธ๋กœ ๋˜์–ด์žˆ๋‹ค. ์ฟผํ„ฐ,๋‹ค์ž„,๋‹ˆ์ผˆ,ํŽ˜๋‹ˆ๋„ ์„ผํŠธ๋„ ๋ฐ”๊พธ๊ณ  ์—ฐ์‚ฐ์„ ์‹คํ–‰ํ•ด์ค€๋‹ค.

124 <-> 25,10,5,1

 

money์™€ ๋™์ „ ํƒ€์ž…์„ ๋‚˜๋ˆˆ ๋ชซ์€ ๊ฐ ๋™์ „ ๊ฐœ์ˆ˜๊ฐ€ ๋˜๋ฉฐ,

๋‚˜๋ˆˆ ๋‚˜๋จธ์ง€ ๊ฐ’์ด ๋‹ค์Œ money ๊ฐ’์ด ๋˜์–ด์•ผํ•œ๋‹ค. !!