1271번

백준

[JAVA] 백준 1271번 엄청난 부자2

import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); BigInteger a = scanner.nextBigInteger(); BigInteger b = scanner.nextBigInteger(); System.out.println(a.divide(b)); System.out.println(a.remainder(b)); } } 문제점 : 10의 1000승까지 출력돼야하는데 int, long 등은 출력하지 못함. 그렇기 때문에 무한한 수를 출력할 수 있는 BigInteger를 사..

DEV장화
'1271번' 태그의 글 목록