2:A-B Problem

Description
Calculate A-B

Input
Two decimal integers a and b(-10^100 < a,b < 10^100) in one line, separated by one space.

Output
Output a-b in one line.

Sample Input

1 2


Sample Output

-1


package OJ;

import java.math.BigInteger;
import java.util.*;

public class P2 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		BigInteger i1 = in.nextBigInteger();               //10^100需要使用大整型
		BigInteger i2 = in.nextBigInteger();
		BigInteger sum = i1.subtract(i2);
		System.out.println(sum);
	}

}


發佈了24 篇原創文章 · 獲贊 0 · 訪問量 1萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章