Largest product in a series

Project Euler problem #8 solution in C++:

#include <iostream>
#include <string>
using namespace std;
int main(){
  string num=”insert here 1000-digit number from the statement”;
  unsigned long long prod=0,temp;//don’t change the type of variables, there will be really large numbers there
  for(int i=0; i<988; i++){
    for(int j=i; j<i+13; j++)
    if(temp>prod) prod=temp;
  cout << prod << '\n';
  return 0;

Leave a Reply

Name *
Email *