Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _1385
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Введите число");
- int numb = Convert.ToInt32(Console.ReadLine());
- DrawPyramid(numb);
- Console.ReadKey();
- }
- static void DrawPyramid(int numb)
- {
- {
- for (int i = 0; i < numb; i++)
- {
- for (int j = 0; j < numb; j++)
- {
- int per1 = Math.Min(numb - i, numb - j);
- int per2= Math.Min(i + 1, j + 1);
- Console.Write(Math.Min(per1, per2));
- }
- Console.WriteLine();
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment