(高精度运算4.7.29)SGU 112 a^b - b^a(大数的幂运算)

妖妖妈

关注

阅读 140

2023-03-30


package com.njupt.acm;

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

public class SGU_112 {//往SGU提交的时候,需要把类名写成Solution,详细信息,可以去看FAQ

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		
		System.out.println(new BigInteger(a+"").pow(b).subtract(new BigInteger(b+"").pow(a)));
	}
}



精彩评论(0)

0 0 举报