Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- sinda jes glupi
- function pole ($a, $b, $c)
- {
- if($a+$b > $c && $b+$c > $a && $c+$a > $b)
- {
- if($a>0 && $b > 0 && $c > 0)
- {
- $p = ($a+$b+$c) / 2;
- $s = sqrt($p*($p-$a)*($p-$b)*($p-$c));
- return $s;
- }
- else
- {
- echo "nie trojkat";
- $s = 0;
- }
- }
- else
- {
- echo "nie ma takiego trojkata";
- }
- }
- for($i = 0; $i <10; $i++)
- {
- $d = rand(0, 100);
- $e = rand(0, 100);
- $f = rand(0, 100);
- $o = pole ($d, $e, $f);
- echo $o . "</br>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement