Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
?? Solve some Function : GCD/LCM...etc
Versions des environnements
Hi, all.
Happy The Holiday of Labors Day.
Foxer's WORKERS OF ALL LANDS UNITE.
I Need Function : GCD/LCM.
1. GCD
GCD = Greatest Common Divisor
Euclid's implementation of the greatest common divisor of two integers.
e.g
? F_GCD(9, 6) && Return : 3
2. LCM
LCM = Least Common Multiple
(LCM) is the smallest number that two or more numbers will divide into evenly.
? F_LCM(48, 42) && Return : 2
3. Solve : Indeterminate equation of the first degree
Finds the positive integral solutions of an indeterminate equation of the first degree of the form { a*X + b*Y = c }
if can DO, then :
Fx(Max) = ? and Fy(Max) = ?
or
Fx(Min) = ? and Fy(Min) = ?
X = ? and Y = ?
e.g :
if :
X + 3Y = 12
Result :
X = 9, Y = 1
X = 6, Y = 2
X = 3, Y = 3
How to ?
VFP Code/Sample
Thanks
FpxPro Funs
- Tuberose
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement