Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Zadacha4
- {
- class Program
- {
- static void Main(string[] args)
- {
- //Задача .4
- int str, colum;
- Console.Write("Введите кол. строк: ");
- str = Convert.ToInt32(Console.ReadLine());
- Console.Write("Введите кол. столбцов: ");
- colum = Convert.ToInt32(Console.ReadLine());
- int[,] array = new int[str, colum];
- //Заполняем табл.
- for (int i = 0; i < str; i++)
- {
- for (int j = 0; j < colum; j++)
- {
- Console.Write("Введите значение для эл. [" + i + "," + j+"]: ");
- array[i, j] = Convert.ToInt32(Console.ReadLine());
- }
- }
- //Выводим исх. табл.
- Console.WriteLine("Исх. табл.: ");
- for (int i = 0; i < str; i++)
- {
- for (int j = 0; j < colum; j++)
- {
- Console.Write(array[i,j] + " ");
- }
- Console.WriteLine();
- }
- //Выводим обратную табл.
- Console.WriteLine("Обратная табл.: ");
- for (int j = 0; j < colum; j++)
- {
- for (int i = 0; i < str; i++)
- {
- Console.Write(array[i, j] + " ");
- }
- Console.WriteLine();
- }
- Console.Read();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment