samedi 21 mars 2015

Numbers generating with specific rules using PHP

For example I got this integer 110

Let Nx be an integer

Is it possible to generate N1 to N8 (N1 to N8 is an integer) using PHP that confine the following rules:

N1 + N2 + N3 + N4 + N5 + N6 + N7 + N8 = 110 ?


Got no idea what function (e.g. rand(), mt_rand(), using loops etc.) can PHP do that.

Thanks for looking at the Problem.


Aucun commentaire:

Enregistrer un commentaire