Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- int rowsCount = int.Parse(Console.ReadLine());
- int colsCount = int.Parse(Console.ReadLine());
- int[,] matrix = new int[ rowsCount,colsCount];
- for ( int row=0 ;row < matrix.GetLength(0);row++)
- {
- for(int col=0;col<matrix.GetLength(1);col++)
- {
- matrix[row, col] = int.Parse(Console.ReadLine());
- }
- }
- for ( int row=0 ;row < matrix.GetLength(0); row++)
- {
- double avg = 0;
- for(int col=0;col < matrix.GetLength(1); col++)
- {
- Console.Write(matrix[row, col] + " " );
- avg +=matrix[row, col];
- }
- Console.WriteLine(avg/ matrix.GetLength(1));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement