27 lines
698 B
Java
27 lines
698 B
Java
import java.util.Scanner;
|
|
|
|
public class P164_AreaRectangulo {
|
|
public static void main(String[] args) {
|
|
Scanner sc = new Scanner(System.in);
|
|
// Coordenadas de las esquinas opuestas
|
|
int ax, ay, bx, by;
|
|
// Longitud de lados
|
|
int l1 = 0, l2 = 0;
|
|
// Area del rectangulo
|
|
int area;
|
|
while (true) {
|
|
ax = sc.nextInt();
|
|
ay = sc.nextInt();
|
|
bx = sc.nextInt();
|
|
by = sc.nextInt();
|
|
|
|
// Omitir casos de prueba
|
|
if(ax > bx || ay > by) break;
|
|
|
|
l1 = bx - ax;
|
|
l2 = by - ay;
|
|
area = l1 * l2;
|
|
System.out.println(area);
|
|
}
|
|
}
|
|
} |