Example #1
0
std::string SLUFactor::statistics() const
{
   std::stringstream s;
   s  << "Factorizations     : " << std::setw(10) << getFactorCount() << std::endl
      << "  Time spent       : " << std::setw(10) << std::fixed << std::setprecision(2) << getFactorTime() << std::endl
      << "Solves             : " << std::setw(10) << getSolveCount() << std::endl
      << "  Time spent       : " << std::setw(10) << getSolveTime() << std::endl;

   return s.str();
}
Example #2
0
File: 12.cpp Project: nickfun/euler
int main( int argc, char **argv ) {
	int triangle = 0;
	int numFactors = 0;
	int i;
	
	for( i=0; numFactors < 500; i++ ) {
		triangle += i;
		numFactors = getFactorCount(triangle);
		printf("%d : %d \n", triangle, numFactors);
	}

	printf("%d has %d factors\n", triangle, numFactors );

	return 0;
}
Example #3
0
int main(int argc, char *argv[])
{
    uint64_t triangleNumber, n, factorCount;

    triangleNumber  = 0;
    n               = 1;
    factorCount     = 0;

    while (factorCount < 500) {
        triangleNumber  += n;
        n               += 1;
        factorCount     = getFactorCount(triangleNumber);
    }

    printf("%" PRIu64 "\n", triangleNumber);

    return 0;
}