rendered paste body#include <iostream>#include <math.h>using namespace std;bool isprime(int num, int i, int (&primes)[79000]){ for(int j=0;primes[j]<int(sqrt(num)+1);j++) { if(int(num%primes[j]) == 0) { return(true); } } return(false);}//---------------------------------------int main(){ int prime = 1; double sum =2; int i=0; int primes[79000]; primes[0] = 2; while(prime < 999998) { prime+=2; i++; while(isprime(prime,i,primes) && prime < 1000000) { prime+=2; } if(prime > 1000000) { break; } primes[i] = prime; sum+= prime; } cout.setf(ios::fixed,ios::floatfield); cout<<sum<<endl; return(0);}