Advertisement
YavorJS

Square of Stars

May 12th, 2016
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5. static void Main()
  6. {
  7. var arr =int.Parse(Console.ReadLine());
  8. for (var i = 0; i < arr; i++)
  9. {
  10. var output = "";
  11. for (var j = 0; j < arr; j++)
  12. {
  13. if (i == 0 || i == arr - 1 || j == 0 || j == arr - 1)
  14. {
  15. output += "*";
  16. }
  17. else
  18. {
  19. output += " ";
  20. }
  21. }
  22. Console.WriteLine(output);
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement