๋™์  ๋ฉ”๋ชจ๋ฆฌ 2

[C] ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์Šค์ฟจ_7์ฃผ์ฐจ ๋ฌธ์ œ 1: ๋ฐฐ์—ด ์›์†Œ์˜ ๊ธธ์ด

[1] ๋ฌธ์ œ ๋ฌธ์ œ ์„ค๋ช… ๋ฌธ์ž์—ด ๋ฐฐ์—ด strlist๊ฐ€ ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ์ฃผ์–ด์ง‘๋‹ˆ๋‹ค. strlist ๊ฐ ์›์†Œ์˜ ๊ธธ์ด๋ฅผ ๋‹ด์€ ๋ฐฐ์—ด์„ retrunํ•˜๋„๋ก solution ํ•จ์ˆ˜๋ฅผ ์™„์„ฑํ•ด์ฃผ์„ธ์š”. ์ œํ•œ์‚ฌํ•ญ 1 ≤ strlist ์›์†Œ์˜ ๊ธธ์ด ≤ 100 strlist๋Š” ์•ŒํŒŒ๋ฒณ ์†Œ๋ฌธ์ž, ๋Œ€๋ฌธ์ž, ํŠน์ˆ˜๋ฌธ์ž๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ์ž…์ถœ๋ ฅ ์˜ˆ strlist result ["We", "are", "the", "world!"] [2, 3, 3, 6] ["I", "Love", "Programmers."] [1, 4, 12] ์ž…์ถœ๋ ฅ ์˜ˆ ์„ค๋ช… ์ž…์ถœ๋ ฅ ์˜ˆ #1 ["We", "are", "the", "world!"]์˜ ๊ฐ ์›์†Œ์˜ ๊ธธ์ด์ธ [2, 3, 3, 6]์„ returnํ•ฉ๋‹ˆ๋‹ค. ์ž…์ถœ๋ ฅ ์˜ˆ #2 ["I", "Love", "Programmers."]์˜..

[C] ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์Šค์ฟจ_7์ฃผ์ฐจ ๋ฌธ์ œ 2: ์•„์ด์Šค ์•„๋ฉ”๋ฆฌ์นด๋…ธ

๋ฌธ์ œ ์„ค๋ช… ๋จธ์“ฑ์ด๋Š” ์ถ”์šด ๋‚ ์—๋„ ์•„์ด์Šค ์•„๋ฉ”๋ฆฌ์นด๋…ธ๋งŒ ๋งˆ์‹ญ๋‹ˆ๋‹ค. ์•„์ด์Šค ์•„๋ฉ”๋ฆฌ์นด๋…ธ๋Š” ํ•œ์ž”์— 5,500์›์ž…๋‹ˆ๋‹ค. ๋จธ์“ฑ์ด๊ฐ€ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ๋ˆ money๊ฐ€ ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ์ฃผ์–ด์งˆ ๋•Œ, ๋จธ์“ฑ์ด๊ฐ€ ์ตœ๋Œ€๋กœ ๋งˆ์‹ค ์ˆ˜ ์žˆ๋Š” ์•„๋ฉ”๋ฆฌ์นด๋…ธ์˜ ์ž” ์ˆ˜์™€ ๋‚จ๋Š” ๋ˆ์„ ์ˆœ์„œ๋Œ€๋กœ ๋‹ด์€ ๋ฐฐ์—ด์„ return ํ•˜๋„๋ก solution ํ•จ์ˆ˜๋ฅผ ์™„์„ฑํ•ด๋ณด์„ธ์š”. ์ œํ•œ์‚ฌํ•ญ 0 HTML ์‚ฝ์ž… ๋ฏธ๋ฆฌ๋ณด๊ธฐํ•  ์ˆ˜ ์—†๋Š” ์†Œ์Šค #.2 ํ•ด์„ 1. #include ๋ฌธ: ์ด ์ฝ”๋“œ๋Š” ํ‘œ์ค€ ์ž…์ถœ๋ ฅ ๋ฐ ๋™์  ๋ฉ”๋ชจ๋ฆฌ ํ• ๋‹น์„ ์œ„ํ•ด ํ•„์š”ํ•œ ํ—ค๋” ํŒŒ์ผ๋“ค์„ ํฌํ•จํ•˜๊ณ  ์žˆ๋‹ค. 2. int* solution(int money): solution ํ•จ์ˆ˜๋Š” ์ •์ˆ˜ํ˜• ํฌ์ธํ„ฐ๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋Š” ํ•จ์ˆ˜์ด๋‹ค. ์ฆ‰, ๊ฒฐ๊ณผ๋Š” ์ •์ˆ˜ ๊ฐ’์„ ๋ฐฐ์—ด๋กœ ๋‹ด์•„์„œ ๋ฐ˜ํ™˜ํ•˜๊ฒŒ ๋œ๋‹ค. ํ•จ์ˆ˜์˜ ์ธ์ž๋กœ๋Š” ๋ˆ์„ ๋‚˜ํƒ€๋‚ด๋Š” ์ •์ˆ˜ money๊ฐ€ ์ „๋‹ฌ๋œ๋‹ค..