Задача 2D Rectangle Area от java FSiC
Здравейте, в Judge имам 2 верни и 3 runtime errors за тази задача
Идеи?
import java.util.Scanner;
public class RectangleRavnina {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
int x1 = scanner.nextInt();
int y1 = scanner.nextInt();
int x2 = scanner.nextInt();
int y2 = scanner.nextInt();
int w = Math.max(x1,x2) - Math.min(x1,x2);
int h = Math.max(y1,y2) - Math.min(y1,y2);
System.out.println(h*w);
System.out.println(2*(w+h));
}
}