Advertisement
tei123

zadanie cokc

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