Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Linq;
- using System.Collections.Generic;
- namespace CSharp_Shell
- {
- public static class Program
- {
- public static void Main()
- {
- int[,] a=new int[100,100], b=new int[100,100], c=new int[100,100];
- int n,m,p;
- n= Convert.ToInt32(Console.ReadLine());
- m= Convert.ToInt32(Console.ReadLine());
- p= Convert.ToInt32(Console.ReadLine());
- for (int i=1; i<=n;i++)
- for (int j=1; j<=m; j++)
- a[i,j]= Convert.ToInt32(Console.ReadLine());
- for (int j=1; j<=m;j++)
- for (int k=1; k<=p; k++)
- b[j,k]= Convert.ToInt32(Console.ReadLine());
- for (int i=1; i<=n; i++)
- for (int j=1; j<=p; j++)
- for (int k=1; k<=m; k++)
- c[i,j]+=a[i,k]*b[k,j];
- for (int i=1; i<=n; i++)
- {
- for (int j=1; j<=p; j++)
- Console.Write(c[i,j]);
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement