tei123

Untitled

Nov 25th, 2016
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. <html>
  2. <form method="GET" action="spra.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. </body>
  19. </html
  20.  
  21.  
  22. //////////////////////////////////////
  23.  
  24. <html>
  25. <body>
  26. <?php
  27.  
  28. $a=$_GET['jeden'];
  29. $b=$_GET['dwa'];
  30. $c=$_GET['trzy'];
  31.  
  32.  
  33.  
  34. if($a>$c && $b>$c)
  35. {
  36. $suma=$a+$b;
  37. echo "suma wynosi: ".$suma."<br>";
  38. }
  39. if ($a>$b && $c>$b)
  40. {
  41. $suma=$a+$c;
  42. echo "suma wynosi: ".$suma."<br>";
  43. }
  44. if ($b>$a && $c>$a)
  45. {
  46. $suma=$c+$b;
  47. echo "suma wynosi: ".$suma."<br>";
  48. }
  49.  
  50.  
  51.  
  52. if($a<$b &&$a<$c)
  53. echo "minimum: ".$a."<br>";
  54. if($b<$a &&$b<$c)
  55. echo "minimum: ".$b."<br>";
  56. if($c<$a &&$c<$b)
  57. echo "minimum: ".$c."<br>";
  58.  
  59.  
  60.  
  61. if($a%2!=0)
  62. $d=$a;
  63. else $d=1;
  64. if($c%2!=0)
  65. $e=$c;
  66. else $e=1;
  67. if($b%2!=0)
  68. $k=$b;
  69. else $k=1;
  70. $iloczyn=$d*$e*$k;
  71. echo "iloczyn: ".$iloczyn."<br>";
  72.  
  73.  
  74.  
  75.  
  76. $silnia=1;
  77. for($i=1;$i<=$c;$i++)
  78. $silnia=$silnia*$i;
  79. echo "silnia: ".$silnia;
  80.  
  81. ?>
  82. </body>
  83. </html>
Add Comment
Please, Sign In to add comment