HDU 1753 (large -large -plus method)


Title: It is easy to understand

problem -solving ideas: For the topic of the basic operation of large numbers. When the output format is uncertain, we can try it:

1) Remove the tail invalid 0

2) Remove an integer part of less than 1

code is as follows:

package com.njupt.bigInteger;

import java.math.BigDecimal;
import java.util.Scanner;

public class HDU_1753_1 {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		BigDecimal a,b,c;
			a = scanner.nextBigDecimal();
			b= scanner.nextBigDecimal();
			c = a.add(b);
			c = c.stripTrailingZeros();
			String str = c.toPlainString();
				str = str.substring(1);


Random Posts

docker container custom network bridge modify docker0 address

HDU -4403 -A very Hard Aoshu Proplem (DP + DFS + MAP + Multipmentual Principles)

WeChat Mini Program-the window background color is covered with page

D -Silver Cow Party Poj -3268 (DIJ -Figure Reverse) ID

Use tensorflow to perform machine learning instances (linear regression)