Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (!empty($_POST["x1"]||$_POST["x1"]==0)&&!empty($_POST["y1"]||$_POST["y1"]==0)&&!empty($_POST["x2"]||$_POST["x2"]==0)&&!empty($_POST["y1"]||$_POST["y1"]==0)){
- $x1 = $_POST['x1'];
- $y1 = $_POST['y1'];
- $x2 = $_POST['x2'];
- $y2 = $_POST['y2'];
- $S = abs($x1-$x2)*abs($y1-$y2);
- $P = (abs($x1-$x2) + abs($y1-$y2))*2;
- echo "Периметр ".$P;
- echo "<br>Площадь ".$S;
- }
- else{
- echo "Переменные не дошли. Проверьте все еще раз.";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement