import java.util.*;
class Rect {
private int width, height;
public Rect(int width,int height) {
this.width = width;
this.height = height;
}
public int getArea() {
return width*height;
}
}
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int sum=0;
Rect[] arr = new Rect[4];
for(int i=0 ; i<4 ; i++) {
System.out.print(i+1+" 너비와 높이 >>");
int width = sc.nextInt();
int height = sc.nextInt();
arr[i] = new Rect(width,height);
}
System.out.println("저장하였습니다...");
try{
Thread.sleep(1000);
}catch(InterruptedException e){
e.printStackTrace();
}
System.out.println("잠시 기다려 주십시오.");
for(int i=1 ; i<=3 ; i++) {
try{
Thread.sleep(1000);
}catch(InterruptedException e){
e.printStackTrace();
}
System.out.println(".");
}
try{
Thread.sleep(1000);
}catch(InterruptedException e){
e.printStackTrace();
}
for(int i=0 ; i<4 ; i++) {
sum+=arr[i].getArea();
}
System.out.print("사각형의 전체 합은 "+sum+"입니다.");
}
}