Advertisement
Schnuk

687

Jan 17th, 2021
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.85 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace ExamTasks
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.             int x = int.Parse(Console.ReadLine());
  12.             int[,] matrix = new int[10, 10];
  13.             matrix[0, 0] = 1;
  14.             matrix[9, 9] = 1;
  15.             for (int i = 1; i < 10; i++)
  16.             {
  17.                 matrix[0, i] = matrix[0, i - 1] * x;
  18.                 matrix[i, 0] = matrix[i - 1, 0] * x;
  19.                 matrix[9, 9 - i] = matrix[9, 10 - i] * x;
  20.                 matrix[9 - i, 9] = matrix[10 - i, 9] * x;
  21.             }
  22.             for (int i = 0; i < 10; i++)
  23.             {
  24.                 for (int j = 0; j < 10; j++)
  25.                     Console.Write(matrix[i, j] + "\t");
  26.                 Console.WriteLine("");
  27.             }
  28.         }
  29.     }
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement