You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
620 B
22 lines
620 B
<html><body><pre><script>
|
|
document.write("\ndiviser (avec reste) 31 par 5 par soustraction en récusrif \n");
|
|
/* Pseuso code :
|
|
|
|
*/
|
|
function div_avec_reste(opg,opd) {
|
|
console.log("div_avec_reste("+opg+","+opd+")");
|
|
let resultat = [0,0];
|
|
if(opg < opd) {
|
|
resultat = [0,opg];
|
|
return resultat;
|
|
}
|
|
else {
|
|
resultat = div_avec_reste((opg - opd),opd);
|
|
return [resultat[0]+1, resultat[1]];
|
|
}
|
|
}
|
|
var res= div_avec_reste(31,5);
|
|
document.write(res[0] + " reste " + res[1]);
|
|
|
|
</script></pre></body></html>
|
|
|