Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Vérifie si <$array,rel> est un magma
- function rel($x,$y) { // relation
- return $x**$y;
- }
- $array = [1]; // array
- $cloture = "Oui";
- for ($i = 0; $i < count($array); $i++) {
- for ($j = 0; $j < count($array); $j++) {
- if (!in_array(rel($array[$i],$array[$j]),$array)) {
- $cloture = "Non";
- }
- }
- }
- print "Clotûre : ".$cloture."\n";
- if ($cloture == "Oui") {
- print "C'est un magma";
- } else {
- print "C'est pas un magma";
- }
- echo `pause>nul`;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement