daily pastebin goal
83%
SHARE
TWEET

Untitled

a guest Jan 18th, 2018 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if(isset($_POST['a']) && $_POST['a'] != '' &&
  2.    isset($_POST['c']) && $_POST['c'] != '') {
  3.     echo '<h1>Täisnurkne kolmnurk</h1>';
  4.     $a = $_POST['a'];
  5.     $c = $_POST['c'];
  6.     if($c > $a) {
  7.         $b = sqrt($c * $c - $a * $a);
  8.         $s = ($a * $b) / 2;
  9.         echo 'Kolmnurga üks kaatet on ' . round($a, 2) . ' cm. ';
  10.         echo 'Kolmnurga hüpotenuus on ' . round($c, 2) . ' cm.<br>';
  11.         echo 'Selle kolmnurga teine kaatet on ' . round($b, 2) . ' cm.<br>';
  12.         echo 'Selle kolmnurga pindala on ' . round($s, 2) . ' cm<sup>2</sup>.<br>';
  13.         echo '<a href="kolmnurk4.php">Algusesse</a>';
  14.     } else {
  15.         echo 'Viga: paranda viga lähteandmetes.';
  16.     }
  17. }
RAW Paste Data
Top