/******************************************** * Factorization of an integer number * * ----------------------------------------- * * Sample run: * * * * ? 394616 * * * * 2 2 2 107 461 * * * * ----------------------------------------- * * Ref.: "Mathématiques par l'informatique * * individuelle (1) par H. Lehning * * et D. Jakubowicz, Masson, Paris, * * 1982" [BIBLI 06]. * * * * C++ version by J-P Moreau. * * (www.jpmoreau.fr) * ********************************************/ #include #include // Labels: e50,e100,e150,e200 double d,eps,m,n,i; void main() { eps=1e-6; // Enter integer number to be factorized printf("\n"); printf(" ? "); scanf("%lf",&n); printf("\n"); printf(" "); // Test if multiple of 2 e50:d=n-2*int(n/2); if (fabs(d)1) printf("%4.0f\n\n",n); else printf("\n\n"); } // end of file factors.cpp