elsemTim

4.0

Apr 23rd, 2017
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.61 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Zadacha4
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             //Задача .4
  10.             int str, colum;
  11.             Console.Write("Введите кол. строк: ");
  12.             str = Convert.ToInt32(Console.ReadLine());
  13.             Console.Write("Введите кол. столбцов: ");
  14.             colum = Convert.ToInt32(Console.ReadLine());
  15.             int[,] array = new int[str, colum];
  16.  
  17.             //Заполняем табл.
  18.             for (int i = 0; i < str; i++)
  19.             {
  20.                 for (int j = 0; j < colum; j++)
  21.                 {
  22.                     Console.Write("Введите значение для эл. [" + i + "," + j+"]: ");
  23.                     array[i, j] = Convert.ToInt32(Console.ReadLine());
  24.                 }
  25.             }
  26.  
  27.             //Выводим исх. табл.
  28.             Console.WriteLine("Исх. табл.: ");
  29.             for (int i = 0; i < str; i++)
  30.             {
  31.                 for (int j = 0; j < colum; j++)
  32.                 {
  33.                     Console.Write(array[i,j] + " ");
  34.                 }
  35.                 Console.WriteLine();
  36.             }
  37.  
  38.             //Выводим обратную табл.
  39.             Console.WriteLine("Обратная табл.: ");
  40.             for (int j = 0; j < colum; j++)
  41.             {
  42.                 for (int i = 0; i < str; i++)
  43.                 {
  44.                     Console.Write(array[i, j] + " ");
  45.                 }
  46.                 Console.WriteLine();
  47.             }
  48.             Console.Read();
  49.         }
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment