grach

Sunglasses

Jul 19th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.79 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 Sunglasses
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.  
  15.             Console.WriteLine("{0}{1}{0}", new string('*', 2 * n), new string(' ', n));  //първия ред
  16.  
  17.             for (int i = 0; i < n - 2; i++)
  18.             {
  19.                 if (i == (n - 1) / 2 - 1)
  20.                 {
  21.                     Console.WriteLine("*{0}*{1}*{0}*",
  22.                         new string('/', 2 * n - 2),
  23.                         new string('|', n));
  24.                 }
  25.  
  26.                 else
  27.                     Console.WriteLine("*{0}*{1}*{0}*",
  28.                     new string('/', 2 * n - 2),
  29.                     new string(' ', n));
  30.             }
  31.  
  32.             Console.WriteLine("{0}{1}{0}", //последния ред
  33.                 new string('*', 2 * n),
  34.                 new string(' ', n));
  35.         }
  36.     }
  37. }
  38.  
  39.  
  40. // Console.WriteLine("{0}{1}{0}", new string('*', 2 * n), new string(' ', n)); //средния ред
  41.  
  42.  
  43.  
  44.  
  45. // TODO: print *///////*
  46. //       if (i == (n - 1) / 2 - 1)
  47. //         Console.Write(new string('|', n));
  48. //       else
  49. //       Console.Write(new string(' ', n));
  50. //   TODO: print *///////*
  51. //    Console.WriteLine();
  52.  
  53.  
  54.  
  55. //      Console.Write(new string('*', 2 * n));
  56. //    Console.Write(new string(' ', n));
  57. //  Console.WriteLine(new string('*', 2 * n));
  58. //      for (int i = 0; i < n - 2; i++)
  59. //      {
  60. //          // TODO: print the middle part
  61. //      }
  62. //       // Print the bottom part
  63. //       Console.Write(new string('*', 2 * n));
  64. //       Console.Write(new string(' ', n));
  65. //       Console.WriteLine(new string('*', 2 * n));
Advertisement
Add Comment
Please, Sign In to add comment