Advertisement
Guest User

Untitled

a guest
Dec 14th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 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 _20160617_Exam_zad_5
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14. int N = int.Parse(Console.ReadLine());
  15.  
  16. int width = 5 * N;
  17. int pointsLeftRight = N;
  18. int pointsMiddle = 3 * N;
  19.  
  20. Console.WriteLine("{0}{1}{0}",
  21. new string ('.',pointsLeftRight),
  22. new string ('*',3*N));
  23.  
  24. pointsLeftRight--;
  25.  
  26. for (int row = 1; row <= N-1; row++)
  27. {
  28. Console.WriteLine("{0}*{1}*{0}",
  29. new string('.', pointsLeftRight),
  30. new string('.', pointsMiddle));
  31. pointsLeftRight--;
  32. pointsMiddle +=2;
  33. }
  34. Console.WriteLine(new string('*',width));
  35. pointsLeftRight = 0;
  36. for (int row = 1; row <= 2*N; row++)
  37. {
  38. pointsLeftRight++;
  39. pointsMiddle -= 2;
  40. Console.WriteLine("{0}*{1}*{0}",
  41. new string('.', pointsLeftRight),
  42. new string('.', pointsMiddle));
  43.  
  44. }
  45. pointsLeftRight++;
  46. Console.WriteLine("{0}{1}{0}",
  47. new string('.', pointsLeftRight),
  48. new string('*', N-2));
  49.  
  50.  
  51. }
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement