All pastes #1281990 Raw Edit

Someone

public cpp v1 · immutable
#1281990 ·published 2008-12-10 21:16 UTC
rendered paste body
//// Codigo para resolver el problema Google (parte 1)///* * Pruebas.cpp * Flariut~ */#include <iostream>#include <cmath>#include <time.h>#include "primos.h"using std::cout;using std::endl;int main(){	clock_t start = clock();	int i, c;	char p[11]; // Diez digitos + '\0'	const char e500[] = 			"2718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427427466391932003059921817413596629043572900334295260595630738132328627943490763233829880753195251019011573834187930702154089149934884167509244761460668082264800168477411853742345442437107539077744992069551702761838606261331384583000752044933826560297606737113200709328709127443747047230696977209310141692836819025515108657463772111252389784425056953696770785449969967946864454905987931636889230098793";	c = 0;	do{		for(i = 0;i < 10;i++){			p[i] = e500[i + c];		}		p[10] = '\0';		cout << p;		cout << endl;		c++;		if(EsPrimo((unsigned long long)atof(p))){			break;		}	}while(*p); // No pongo en el while lo del primo 'por si no lo llegara a encontrar'	cout << "Che, tardamos: " << double(clock() - start)/CLOCKS_PER_SEC << "segs.";	return 0;}