Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2016
1,213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 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 _02SudokuResults
  8. {
  9. class SudokuResults
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14.  
  15. int n = int.Parse(Console.ReadLine());
  16.  
  17. for (int row = 0; row < n; row++)
  18. {
  19.  
  20. Console.Write(new string(' ', n - row - 1));
  21. for (int col = 0; col <= row; col++)
  22. {
  23. Console.Write('*');
  24. Console.Write(' ');
  25.  
  26. }
  27. Console.WriteLine();
  28. }
  29. for (int row = n - 1; row > 0; row--)
  30. {
  31. Console.Write(new string(' ', n - row));
  32. for (int col = 0; col < row; col++)
  33. {
  34. Console.Write('*');
  35. Console.Write(' ');
  36. }
  37. Console.WriteLine();
  38. }
  39.  
  40. }
  41.  
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement