Greatest product of five consecutive digits in a 1000-digit number

后端 未结 9 1668
旧巷少年郎
旧巷少年郎 2020-12-24 11:15

I am working through the problems on project Euler and am not too certain if my understanding of the question is correct.

Problem 8 is as follows:

9条回答
  •  梦谈多话
    2020-12-24 11:46

    A digit is a single 0-9 in the string representing the number. So the number 12345 has 5 digits. 1234554321 has 10 digits.

    The product is the multiplicative total, not the added total. So the product of 3, 5 and 7 is 105.

    A (somewhat clunky) way of rephrasing the question would be:

    Given a 1000-digit number, select 5 consecutive digits from it that, when taken as individual numbers and multiplied together, give the largest result.

提交回复
热议问题