Advertisement
tei123

sprawdzian

Nov 25th, 2016
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. <html>
  2. <form method="GET" action="hsh.php">
  3. <body>
  4. <p>A
  5. <input type="text" name="jeden">
  6.  
  7. B
  8. <input type="text" name="dwa">
  9.  
  10. C
  11. <input type="text" name="trzy">
  12. </p><br>
  13. <input name="suma" type="submit" value="suma"><br><br>
  14. <input name="min" type="submit" value="min"><br><br>
  15. <input name="iloczyn" type="submit" value="iloczyn"><br><br>
  16. <input name="silnia" type="submit" value="silnia"><br>
  17. </form>
  18.  
  19.  
  20.  
  21. <?php
  22.  
  23. $a=$_GET['jeden'];
  24. $b=$_GET['dwa'];
  25. $c=$_GET['trzy'];
  26.  
  27.  
  28.  
  29. if($a>$c && $b>$c)
  30. {
  31. $suma=$a+$b;
  32. echo "suma wynosi: ".$suma."<br>";
  33. }
  34. if ($a>$b && $c>$b)
  35. {
  36. $suma=$a+$c;
  37. echo "suma wynosi: ".$suma."<br>";
  38. }
  39. if ($b>$a && $c>$a)
  40. {
  41. $suma=$c+$b;
  42. echo "suma wynosi: ".$suma."<br>";
  43. }
  44.  
  45.  
  46.  
  47. if($a<$b &&$a<$c)
  48. echo "minimum: ".$a."<br>";
  49. if($b<$a &&$b<$c)
  50. echo "minimum: ".$b."<br>";
  51. if($c<$a &&$c<$b)
  52. echo "minimum: ".$c."<br>";
  53.  
  54.  
  55.  
  56. if($a%2!=0)
  57. $d=$a;
  58. else $d=1;
  59. if($c%2!=0)
  60. $e=$c;
  61. else $e=1;
  62. if($b%2!=0)
  63. $k=$b;
  64. else $k=1;
  65. $iloczyn=$d*$e*$k;
  66. echo "iloczyn: ".$iloczyn."<br>";
  67.  
  68.  
  69.  
  70.  
  71. $silnia=1;
  72. for($i=1;$i<=$c;$i++)
  73. $silnia=$silnia*$i;
  74. echo "silnia: ".$silnia;
  75.  
  76. ?>
  77. </body>
  78. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement