Skip to content

Instantly share code, notes, and snippets.

@retornam
Created September 9, 2010 18:32
Show Gist options
  • Save retornam/572293 to your computer and use it in GitHub Desktop.
Save retornam/572293 to your computer and use it in GitHub Desktop.
#include<iostream>
#include<cstdlib>
#include<cmath>
using namespace std;
int main()
{
int numToBeFactored =133745639;
int i;
for(i=2; i<(0.5 + sqrt(nLoopCount));i++)
{
double tmp = numToBeFactored/static_cast<double>(i);
if(tmp ==static_cast<int> (tmp))
{
cout<<i << ", "<< static_cast<int>(tmp)<<"\n";
cout<< i+static_cast<int>(tmp)<<"\n";
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment