Advertisement
NonaG

NumberTable

Dec 3rd, 2016
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 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 NumberTable
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var n = int.Parse(Console.ReadLine());
  14. var count = 0;
  15. for (int row = 0; row <= n; row++)
  16. {
  17. for (int column = 0; column <= n; column++)
  18. {
  19. count = row + column + 1;
  20. if (count < n)
  21. {
  22. Console.Write(count + " ");
  23. }
  24.  
  25. else if (count == n)
  26. {
  27. Console.WriteLine(count);
  28. }
  29.  
  30. }
  31. }
  32.  
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement