fork download
  1. <?php
  2.  
  3. $a = 10;
  4. $b = 5;
  5. $c = 7;
  6.  
  7. // Adadi kalontarinro meyobem
  8. $max = $a;
  9. if ($b > $max) {
  10. $max = $b;
  11. }
  12. if ($c > $max) {
  13. $max = $c;
  14. }
  15.  
  16. // Adadi khurdtarinro meyobem
  17. $min = $a;
  18. if ($b < $min) {
  19. $min = $b;
  20. }
  21. if ($c < $min) {
  22. $min = $c;
  23. }
  24.  
  25. // Adadi miyonaro meyobem
  26. $middle = $a;
  27. if ($a != $max && $a != $min) {
  28. $middle = $a;
  29. } else if ($b != $max && $b != $min) {
  30. $middle = $b;
  31. } else {
  32. $middle = $c;
  33. }
  34.  
  35. echo "Adadi kalontarin: " . $max . "\n";
  36. echo "Adadi khurdtarin: " . $min . "\n";
  37. echo "Adadi miyona: " . $middle . "\n";
  38.  
  39. ?>
Success #stdin #stdout 0.03s 25924KB
stdin
Standard input is empty
stdout
Adadi kalontarin: 10
Adadi khurdtarin: 5
Adadi miyona: 7