Advertisement
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 _4.Draw_a_Filled_Square
- {
- class Program
- {
- static void FigureHeader(int n)
- {
- Console.WriteLine(new string('-', 2 * n));
- }
- static void FigureBody(int n)
- {
- Console.Write('-');
- for (int i = 1; i < n; i++)
- {
- Console.Write("\\/");
- }
- Console.WriteLine('-');
- }
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- FigureHeader(n);
- for (int i = 0; i < n - 2; i++)
- {
- FigureBody(n); // Тук пишеше FigureBody(i)
- }
- FigureHeader(n);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement