https://projecteuler.net/problem=8
int main()
{
std::string value[20];
init_series_PE8(value);
unsigned int long long current_max = 0;
int max_row = 0, max_start_index = 0;
for (int i = 0; i < 20; ++i)
{
std::cout << "ROW " << i+1 << "\n---------------------\n";
for (int j = 0; j < (50-11); ++j)
{
unsigned int long long accumulator = 1;
for (int k = 0; k < 13; ++k)
{
accumulator *= atoi(value[i][j + k]);
}
if (accumulator > current_max)
{
current_max = accumulator;
}
}
}
std::cout << "Max is: " << current_max << "\n";
}
Any ideas why the above code is displaying 2490394032, which isn't the right value
A website dedicated to the fascinating world of mathematics and programming