nyoj 73 比大小 【java大数】

来源:互联网 发布:武汉网络电视 编辑:程序博客网 时间:2024/06/06 19:15

java大数。

代码:

import java.util.Scanner;import java.math.*;public class Main{public static void main(String[] args){Scanner cin = new Scanner(System.in);BigInteger a, b;BigInteger t = BigInteger.valueOf(0);a = cin.nextBigInteger();b = cin.nextBigInteger();while(!(a.equals(t)&&b.equals(t))){if(a.equals(b)){System.out.println("a==b");}else if(a.compareTo(b)>0){System.out.println("a>b");}else System.out.println("a<b");a = cin.nextBigInteger();b = cin.nextBigInteger();}}}        
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=73

0 0