Advertisement
YavorJS

Square of Stars

May 31st, 2016
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.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 SquareOfStars
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var arr =int.Parse(Console.ReadLine());
  14. for (var i = 0; i < arr; i++)
  15. {
  16. var output = "";
  17. for (var j = 0; j < arr; j++)
  18. {
  19. if (i == 0 || i == arr - 1 || j == 0 || j == arr - 1)
  20. {
  21. output += "*";
  22. }
  23. else
  24. {
  25. output += " ";
  26. }
  27. }
  28. Console.WriteLine(output);
  29. }
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement