Advertisement
social1986

Untitled

Oct 3rd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 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. public static void PrintHeader(int input)
  12. {
  13. Console.WriteLine(new string('-', input * 2));
  14. }
  15.  
  16. public static void PrintMiddleRow(int input)
  17. {
  18. Console.Write("-");
  19. for (int j = 1; j < input; j++)
  20. {
  21. Console.Write("\\/");
  22. }
  23. Console.WriteLine("-");
  24. }
  25.  
  26. public static void PrintAllMiddleRows(int input)
  27. {
  28. for (int i = 0; i < input - 2; i++)
  29. {
  30. PrintMiddleRow(input);
  31. }
  32. }
  33.  
  34. public static void PrintFilledSquare(int input)
  35. {
  36. PrintHeader(input);
  37. PrintAllMiddleRows(input);
  38. PrintHeader(input);
  39. }
  40.  
  41. static void Main(string[] args)
  42. {
  43. int inputNumber = int.Parse(Console.ReadLine());
  44. PrintFilledSquare(inputNumber);
  45. }
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement