zufe oj Problem H: 简单数学题 java

a的b次和c的d次比较大小

import java.math.BigInteger;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner in=new Scanner(System.in);
        int i=0,n=0,m=0,cas=0;
        int b,d;
        BigInteger a,c;
        while(in.hasNext())
        {
            a=in.nextBigInteger();
            b=in.nextInt();
            c=in.nextBigInteger();
            d=in.nextInt();
            a=a.pow(b);
            c=c.pow(d);
            int f=a.compareTo(c);
            if(f==-1)
            System.out.println('<');
            else if(f==1) 
                System.out.println('>');
            else if(f==0)
                System.out.println('=');
        }
        in.close();
    }

}

你可能感兴趣的:(zufe oj Problem H: 简单数学题 java)