Notice
Recent Posts
Recent Comments
Link
«   2024/10   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

main

[백준-1271번/Java] 엄청난 부자2 본문

Algorithm

[백준-1271번/Java] 엄청난 부자2

1984 2022. 11. 19. 20:20

* BigInteger 사용

import java.io.*;
import java.util.*;
import java.math.*;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		StringTokenizer stk = new StringTokenizer(br.readLine(), " ");

		BigInteger N = new BigInteger(stk.nextToken());
		BigInteger M = new BigInteger(stk.nextToken());

		System.out.println(N.divide(M));
		System.out.println(N.remainder(M));
	}

}
Comments