Java/백준 알고리즘(JAVA)
백준 / Java / 10998번 / A x B
정복잉
2022. 10. 26. 16:59
반응형
더보기
백준 / Java / 10998번 / A x B
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n1 = sc.nextInt();
int n2 = sc.nextInt();
System.out.print(n1*n2);
}
}
유사 문제
2022.10.26 - [Java/백준 알고리즘(JAVA)] - 백준 / Java / 1000번 / A+B / Scanner
백준 / Java / 1000번 / A+B / Scanner
import java.util.*; // :: 보통 utill.* (utill 패키지의 전체 클래스 선언 = all) public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int num1 = sc.nextInt(..
earth-sunny.tistory.com
2022.10.26 - [Java/백준 알고리즘(JAVA)] - 백준 / Java / 1001번 / A-B / Scanner
백준 / Java / 1001번 / A-B / Scanner
백준 / JAVA / 1001번 / A-B import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n1 = sc.nextInt(); int n2 = sc.nextInt(); System.o..
earth-sunny.tistory.com
백준에서는 런타임 에러로 떠서 사용 할 수 없지만 BufferdeReader로 할 경우이다.
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
int n1 = Integer.parseInt(st.nextToken());
int n2 = Integer.parseInt(st.nextToken());
bw.write(String.valueOf(n1*n2));
bw.flush();
bw.close();
}
}