bacco

Пеперуда

Feb 12th, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.55 KB | None | 0 0
  1. using System;
  2.  
  3. namespace zi
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             var n = int.Parse(Console.ReadLine());
  10.  
  11.            for (int i = 1; i <= n - 2; i++)
  12.             {
  13.                if (i % 2 != 0)
  14.                 {
  15.                     int topStarsCount = n - 2;
  16.                     string topStars = new string('*', topStarsCount);
  17.                     Console.WriteLine($"{topStars}\\ /{topStars}");
  18.                 }
  19.                 else
  20.                 {
  21.                     int topdashCount = n - 2;
  22.                     string topdash = new string('-', topdashCount);
  23.                     Console.WriteLine($"{topdash}\\ /{topdash}");
  24.                 }
  25.             }
  26.             //        ..... MIDLE UP
  27.  
  28.             int midSpacesCount = n - 1;
  29.             string midSpaces = new string(' ', midSpacesCount);
  30.             Console.WriteLine($"{midSpaces}@");
  31.  
  32.             //        ..... MIDLE DOWN
  33.  
  34.             for (int i = 1; i <= n - 2; i++)
  35.             {
  36.                 if (i % 2 != 0)
  37.                 {
  38.                     int topStarsCount = n - 2;
  39.                     string topStars = new string('*', topStarsCount);
  40.                     Console.WriteLine($"{topStars}/ \\{topStars}");
  41.                 }
  42.                 else
  43.                 {
  44.                     int topdashCount = n - 2;
  45.                     string topdash = new string('-', topdashCount);
  46.                     Console.WriteLine($"{topdash}/ \\{topdash}");  
  47.                 }
  48.             }
  49.  
  50.         }
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment