๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๊ฑฐ์Šค๋ฆ„๋ˆ1

[๋ฐฑ์ค€/C++] 5585๋ฒˆ : ๊ฑฐ์Šค๋ฆ„๋ˆ ๋ฌธ์ œ ํƒ€๋กœ๋Š” ์ž์ฃผ JOI์žกํ™”์ ์—์„œ ๋ฌผ๊ฑด์„ ์‚ฐ๋‹ค. JOI์žกํ™”์ ์—๋Š” ์ž”๋ˆ์œผ๋กœ 500์—”, 100์—”, 50์—”, 10์—”, 5์—”, 1์—”์ด ์ถฉ๋ถ„ํžˆ ์žˆ๊ณ , ์–ธ์ œ๋‚˜ ๊ฑฐ์Šค๋ฆ„๋ˆ ๊ฐœ์ˆ˜๊ฐ€ ๊ฐ€์žฅ ์ ๊ฒŒ ์ž”๋ˆ์„ ์ค€๋‹ค. ํƒ€๋กœ๊ฐ€ JOI์žกํ™”์ ์—์„œ ๋ฌผ๊ฑด์„ ์‚ฌ๊ณ  ์นด์šดํ„ฐ์—์„œ 1000์—” ์ง€ํ๋ฅผ ํ•œ์žฅ ๋ƒˆ์„ ๋•Œ, ๋ฐ›์„ ์ž”๋ˆ์— ํฌํ•จ๋œ ์ž”๋ˆ์˜ ๊ฐœ์ˆ˜๋ฅผ ๊ตฌํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค. ์ž…๋ ฅ ์ž…๋ ฅ์€ ํ•œ์ค„๋กœ ์ด๋ฃจ์–ด์ ธ์žˆ๊ณ , ํƒ€๋กœ๊ฐ€ ์ง€๋ถˆํ•  ๋ˆ(1 ์ด์ƒ 1000๋ฏธ๋งŒ์˜ ์ •์ˆ˜) 1๊ฐœ๊ฐ€ ์“ฐ์—ฌ์ ธ์žˆ๋‹ค. ์ถœ๋ ฅ ์ œ์ถœํ•  ์ถœ๋ ฅ ํŒŒ์ผ์€ 1ํ–‰์œผ๋กœ๋งŒ ๋˜์–ด ์žˆ๋‹ค. ์ž”๋ˆ์— ํฌํ•จ๋œ ๋งค์ˆ˜๋ฅผ ์ถœ๋ ฅํ•˜์‹œ์˜ค. ํ’€์ด // ๊ฑฐ์Šค๋ฆ„๋ˆ #include using namespace std; int main(){ int money, cnt=0; cin >> money; money = 1000-money; int.. 2021. 8. 15.