VitalyD

Untitled

Jun 13th, 2017
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.92 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 _1385
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.WriteLine("Введите число");
  14.             int numb = Convert.ToInt32(Console.ReadLine());
  15.  
  16.             DrawPyramid(numb);
  17.             Console.ReadKey();
  18.         }
  19.  
  20.         static void DrawPyramid(int numb)
  21.         {
  22.             {
  23.                 for (int i = 0; i < numb; i++)
  24.                 {
  25.                     for (int j = 0; j < numb; j++)
  26.                     {
  27.                         int per1 = Math.Min(numb - i, numb - j);
  28.                         int per2= Math.Min(i + 1, j + 1);
  29.                         Console.Write(Math.Min(per1, per2));
  30.                     }
  31.                     Console.WriteLine();
  32.                 }
  33.             }
  34.  
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment