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