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++){
    temp=1;
    for(int j=i; j<i+13; j++)
    temp*=(num[j]-‘0’);
    if(temp>prod) prod=temp;
  }
  cout << prod << '\n';
  system(“pause”);
  return 0;
}

10001st prime

Project Euler problem #7 solution in C++ (Eratosphene’s sieve used):

#include <iostream>
#include <vector>
using namespace std;
int main(){
  vector<unsigned long long> num(10001);
  num[0]=2; num[1]=3; num[2]=5; num[3]=7; num[4]=11; num[5]=13;
  unsigned long long j=17;
  int i=5;
  do{
    for(int k=0;k<i;k++){
      if(j%num[k]==0){
        j+=2;
        break;
      }
      if(k==(i-1)){
        i++;
        num[i]=j;
        j+=2;
        break;
      }
    }
  }while(i<10001);
  cout << num[10000] << '\n';
  system(“pause”);
  return 0;
}