import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int ai=sc.nextInt(); int aj=sc.nextInt(); BigInteger[][]a=new BigInteger[ai][aj]; for (int i = 0; i < ai; i++) { for (int j = 0; j < aj; j++) { a[i][j]=new BigInteger( sc.next()); } } int bi=sc.nextInt(); int bj=sc.nextInt(); BigInteger[][]b=new BigInteger[bi][bj]; for (int i = 0; i < bi; i++) { for (int j = 0; j < bj; j++) { b[i][j]=new BigInteger( sc.next()); } } for (int i = 0; i < ai; i++) { for (int j = 0; j < bj; j++) { BigInteger sum=new BigInteger("0"); for (int k = 0; k < aj; k++){ sum=sum.add(a[i][k].multiply(b[k][j])); } System.out.print(sum+" "); } System.out.println(); } } }
0.0分
1 人评分
剔除相关数 (C语言代码)浏览:1017 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:617 |
这可能是一个假的冒泡法浏览:993 |
上车人数 (C语言代码)浏览:781 |
程序员的表白 (C语言代码)浏览:667 |
C语言程序设计教程(第三版)课后习题6.3 (C语言代码)浏览:947 |
2004年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:506 |
IP判断 (C语言代码)浏览:764 |
C语言程序设计教程(第三版)课后习题6.9 (C语言代码)浏览:642 |
A+B for Input-Output Practice (IV) (C语言代码)浏览:493 |