Guest User

Untitled

a guest
Dec 6th, 2019
103
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace ConsoleApp1
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int n = int.Parse(Console.ReadLine());
  10. int[,] a = new int[n, n];
  11. for (int i = 0; i < n; i++)
  12. {
  13. for (int j = 0; j < i; j++)
  14. {
  15. a[i, j] = 0;
  16. }
  17.  
  18. for (int j = i; j < n; j++)
  19. {
  20. a[i, j] = 1;
  21. }
  22. }
  23. for (int i = 0; i < n; i++)
  24. {
  25. for (int j = 0; j < n; j++)
  26. {
  27. char c = '*';
  28. if(a[i,j]==0)
  29. {
  30. c = ' ';
  31. }
  32. Console.Write(c);
  33. }
  34. Console.WriteLine();
  35. }
  36. }
  37. }
  38. }
RAW Paste Data