본문 바로가기

알고리즘/백준

[백준] 27323 - 직사각형 (JAVA/ 자바)

반응형

27323번 문제(1)
27323번 문제(2)

 

1.Scanner를 이용한 방법

import java.util.Scanner;

public class Main{
public static void main(String[] args){

    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();

    System.out.println(A*B);
    sc.close();
    }
}

 

2. BufferedReader를 이용한 방법

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{
public static void main(String[] args)throws IOException{

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int A = Integer.parseInt(br.readLine());
    int B = Integer.parseInt(br.readLine());

    System.out.println(A*B);
    br.close();
    }
}

 

간단하게 A X B를 하면 되는 문제다.

반응형