Advertisement
tei123

zadanie

Nov 8th, 2016
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta charset="UTF-8">
  4. </head>
  5. <body>
  6. <form method="GET" action="ptest.php">
  7. <p> a:<input type="text" name="a"> b:<input type="text" name="b"> c:<input type="text" name="c"></p>
  8. <p><input type="submit" name="iloczyn" value="iloczyn"></p>
  9. <p><input type="submit" name="max" value="max"></p>
  10. <p><input type="submit" name="suma" value="suma"></p>
  11. <p><input type="submit" name="silnia" value="silnia"></p>
  12. </form>
  13. </body>
  14. <html>
  15.  
  16. ----------------------PHP-------------------------
  17. <html>
  18. <body>
  19. PHP
  20. <br/><br/>
  21. <?php
  22. $a=($_GET['a']);
  23. $b=($_GET['b']);
  24. $c=($_GET['c']);
  25. if($a>$b && $a>$c)//iloczyn i max
  26. {
  27. $il=$b*$c;
  28. $max=$a;
  29. }
  30. if($b>$a && $b>$c)
  31. {
  32. $il=$a*$c;
  33. $max=$b;
  34. }
  35. if($c>$b && $c>$a)
  36. {
  37. $il=$b*$a;
  38. $max=$c;
  39. }
  40. $sum=0;//suma
  41. if($a%2==0)
  42. $sum+=$a;
  43. if($b%2==0)
  44. $sum+=$b;
  45. if($c%2==0)
  46. $sum+=$b;
  47. $sil=1;//silnia
  48. for($i=1; $i<=$a; $i++)
  49. $sil*=$i;
  50. echo "iloczyn: ".$il."<br/>";
  51. echo "max: ".$max."<br/>";
  52. echo "suma: ".$sum."<br/>";
  53. echo "silnia: ".$sil."<br/>";
  54. ?>
  55. </body>
  56. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement