Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <form method="GET" action="hsh.php">
- <body>
- <p>A
- <input type="text" name="jeden">
- B
- <input type="text" name="dwa">
- C
- <input type="text" name="trzy">
- </p><br>
- <input name="suma" type="submit" value="suma"><br><br>
- <input name="min" type="submit" value="min"><br><br>
- <input name="iloczyn" type="submit" value="iloczyn"><br><br>
- <input name="silnia" type="submit" value="silnia"><br>
- </form>
- <?php
- $a=$_GET['jeden'];
- $b=$_GET['dwa'];
- $c=$_GET['trzy'];
- if($a>$c && $b>$c)
- {
- $suma=$a+$b;
- echo "suma wynosi: ".$suma."<br>";
- }
- if ($a>$b && $c>$b)
- {
- $suma=$a+$c;
- echo "suma wynosi: ".$suma."<br>";
- }
- if ($b>$a && $c>$a)
- {
- $suma=$c+$b;
- echo "suma wynosi: ".$suma."<br>";
- }
- if($a<$b &&$a<$c)
- echo "minimum: ".$a."<br>";
- if($b<$a &&$b<$c)
- echo "minimum: ".$b."<br>";
- if($c<$a &&$c<$b)
- echo "minimum: ".$c."<br>";
- if($a%2!=0)
- $d=$a;
- else $d=1;
- if($c%2!=0)
- $e=$c;
- else $e=1;
- if($b%2!=0)
- $k=$b;
- else $k=1;
- $iloczyn=$d*$e*$k;
- echo "iloczyn: ".$iloczyn."<br>";
- $silnia=1;
- for($i=1;$i<=$c;$i++)
- $silnia=$silnia*$i;
- echo "silnia: ".$silnia;
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement