51Nod-1029 divisão inteira (versão Java)

título

https://vjudge.net/problem/51Nod-1029

código

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.StringTokenizer;

public class Main {

	/**
	 * @param args
	 * @throws Exception 
	 */
	public static void main(String[] args) throws Exception {
		BigInteger A = new BigInteger(_06Reader.nextLine());
		BigInteger B = new BigInteger(_06Reader.nextLine());
		System.out.println(A.divide(B));
		System.out.println(A.mod(B));
	}

}
class _06Reader {
	static BufferedReader br = new BufferedReader(new InputStreamReader(
			System.in));
	static StringTokenizer tokenizer = new StringTokenizer("");

	static String next() throws Exception {
		while (!tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(br.readLine());
		}
		return tokenizer.nextToken();
	}

	static String nextLine() throws Exception {
		return br.readLine();
	}

	static int nextInt() throws Exception {
		return Integer.parseInt(next());
	}

}
Publicado 60 artigos originais · ganhou elogios 4 · Vistas 1251

Acho que você gosta

Origin blog.csdn.net/qq_43966129/article/details/105368268
Recomendado
Clasificación