Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- double x1 = Double.parseDouble(scan.nextLine());
- double y1 = Double.parseDouble(scan.nextLine());
- double x2 = Double.parseDouble(scan.nextLine());
- double y2 = Double.parseDouble(scan.nextLine());
- System.out.println(Math.abs(x1-x2)* Math.abs(y1 - y2));
- System.out.println(2 * (Math.abs(x1-x2) + Math.abs(y1-y2)));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement