
阿小 - 云代码空间
——
import java.math.BigInteger;
import java.util.Scanner;
public class Main {
public static void main(String args[])
{
Scanner cin = new Scanner(System.in);
int T = cin.nextInt();
int cnt = 0;
for (int i=0; i<T; i++)
{
BigInteger num = cin.nextBigInteger();
BigInteger m = cin.nextBigInteger();
BigInteger ans =new BigInteger("0");
BigInteger a = new BigInteger("2");
ans = num.multiply(m);
ans = ans.divide(a);
cnt++;
System.out.print("Case"+" "+cnt+":");
System.out.println(ans);
}
}
}
通过这个题,把Java的BigInteger学习一下,下面给个链接吧:http://www.cis.upenn.edu/~bcpierce/courses/629/jdkdocs/api/java.math.BigInteger.html