Advertisement
RukoLob

1.3.8.5

Aug 17th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.96 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp2
  8. {
  9.     class Program
  10.     {
  11.         private static int Numb;
  12.         static void Main(string[] args)
  13.         {
  14.             Console.WriteLine("Размер");
  15.             Numb = Convert.ToInt32(Console.ReadLine());
  16.             for (int x = 0; x < Numb; x++)
  17.             {
  18.                 for (int y = 0; y < Numb; y++)
  19.                 {
  20.                     Console.SetCursorPosition(x, y);
  21.                     int min = x < y ? x : y;
  22.                     int max = x > y ? x : y;
  23.                     if (x + y < Numb)
  24.                     {
  25.                         Console.Write(min + 1);
  26.                     }
  27.                     else
  28.                     {
  29.                         Console.Write(Numb - max);
  30.                     }
  31.                 }
  32.             }
  33.             Console.ReadLine();
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement