Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Christmas Math Fun
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00064933
Message ID:
00065082
Vues:
37
>>OK, Bruce, you said no looping, but you didn't say no recursion:
>>
>>FUNCTION Gifts
>>
>>LPARAMETER pnDays
>>
>>LOCAL lnresult
>>lnresult = 0
>>IF pnDays > 0
>> lnresult = ((pnDays * (pnDays + 1 ) ) / 2) + Gifts(pnDays - 1)
>>ENDIF
>>RETURN lnresult
>>ENDFUNC
>>
>
>Uh-oh! Well, Edward P. found the desired solution, but we'll have to grant you some credit for wily thinking and interesting technique. :~)

Thank you, but give Ed all the credit. He found the correct mathematical solution, I just used a trick (faking the loop) ;-).

George
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform