์žฌ๊ท€ํ•จ์ˆ˜

ํ•™์Šตํ•œ ์žฌ๊ท€ ํ•จ์ˆ˜ ๋‚ด์šฉ์„ ํ™œ์šฉํ•˜์—ฌ ์ž…๋ ฅ๋œ ์ •์ˆ˜์˜ ๋ชจ๋“  ์ž๋ฆฟ์ˆ˜๋ฅผ ๋ง์…ˆํ•œ ๊ฐ’์„ ๋ฐ˜ํ™˜ํ•˜๋Š” ํ•จ์ˆ˜๋ฅผ ์ž‘์„ฑํ•ด ๋ด…์‹œ๋‹ค. Test cases) '1234' → (1 + 2 + 3 + 4) = 10 '99999' → (9 + 9 + 9 + 9 + 9) = 45 '1000000000' → (1 + 0 + 0 + ... + 0) = 1 ์ฝ”๋“œ #include using namespace std; int sum_of_digits(int); int main() { cout
Chan Lee
'์žฌ๊ท€ํ•จ์ˆ˜' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก