fbinnzhivko

07.01 Console Graphics

May 16th, 2016
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1. using System;
  2. public class ConsoleGraphics
  3. {
  4.     static void Main()
  5.     {
  6.         int size = int.Parse(Console.ReadLine());
  7.         int lineLenght = 2 * size;
  8.  
  9.         for (int i = 0; i < 2; i++)
  10.         {
  11.             Console.WriteLine(new string('*', lineLenght));
  12.         }
  13.         for (int i = 0; i < size - 1; i++)
  14.         {
  15.             Console.Write(new string('*', (size + 1) / 2));
  16.             Console.Write(new string(' ', size - 1));
  17.             Console.Write(new string('*', (size + 1) / 2));
  18.             Console.WriteLine();
  19.         }
  20.         for (int i = 0; i < 2; i++)
  21.         {
  22.             Console.WriteLine(new string('~', lineLenght));
  23.         }
  24.     }
  25. }
Add Comment
Please, Sign In to add comment