Project Euler: Problem 16 (C/C++)

Поділитися
Вставка
  • Опубліковано 29 гру 2024

КОМЕНТАРІ •

  • @Voidd32
    @Voidd32 5 місяців тому

    Your videos are extremely helpful , thank you!

  • @ch3s7eRB
    @ch3s7eRB 4 роки тому

    Why do we need to divide hex number with 10? I understood the whole procedure and code but couldn't figure out why we should divide it 10 exactly. Great video though! :D Thank You!

    • @MatthewBouyack
      @MatthewBouyack  4 роки тому +1

      Hello, thanks for the view! The reason we divide by ten is because the problem asks us to find the sum of the decimal digits. Since decimal is a base-10 number system we need to divide (and take the remainder) by 10 to get the digits. You can see an example in the video starting at 4:19