Advertisement
Guest User

Untitled

a guest
Oct 5th, 2017
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 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 _4.Draw_a_Filled_Square
  8. {
  9.     class Program
  10.     {
  11.         static void FigureHeader(int n)
  12.         {
  13.             Console.WriteLine(new string('-', 2 * n));
  14.         }
  15.         static void FigureBody(int n)
  16.         {
  17.             Console.Write('-');
  18.             for (int i = 1; i < n; i++)
  19.             {
  20.                 Console.Write("\\/");
  21.             }
  22.             Console.WriteLine('-');
  23.         }
  24.  
  25.         static void Main(string[] args)
  26.         {
  27.             int n = int.Parse(Console.ReadLine());
  28.             FigureHeader(n);
  29.             for (int i = 0; i < n - 2; i++)
  30.             {
  31.                 FigureBody(n); // Тук пишеше FigureBody(i)
  32.             }
  33.             FigureHeader(n);
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement