2018年北京信息科技大学第十届程序设计竞赛暨ACM选拔赛 E-233

题目链接:https://www.nowcoder.com/acm/contest/118/E

看到大数直接套JAVA,但是后面MekakuCityActors大佬和我说可以找规律(>_<),仔细想想确实可以,下面是我的java实现代码:

 1 import java.math.BigInteger;
 2 import java.util.Scanner;
 3 
 4 
 5 public class Main {
 6     public static void main(String arg[]) {
 7         Scanner sc = new Scanner(System.in);
 8         while(sc.hasNext()) {
 9             int T = sc.nextInt();
10             while((T--) > 0 ) {
11                 BigInteger a = sc.nextBigInteger();
12                 BigInteger b = sc.nextBigInteger();
13                 System.out.println(a.multiply(b));
14             }
15         }
16         sc.close();
17     }
18 }

猜你喜欢

转载自www.cnblogs.com/Dillonh/p/8995015.html
今日推荐