51Nod-1028 grandes números se multiplican V2 (versión Java)

título

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

pensamiento

De entrada se utiliza objetos BigInteger
multiplicadores multiplican

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(_04Reader.nextLine());
		BigInteger B = new BigInteger(_04Reader.nextLine());
		System.out.println(A.multiply(B));
	}

}
class _04Reader {
	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 artículos originales · ganado elogios 4 · Vistas 1252

Supongo que te gusta

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