Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class NumberTable
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- for (int row = 0; row < n; row++)
- {
- for (int col = 0; col < n; col++)
- {
- int num = row + col + 1;
- if (num > n)
- {
- num = 2 * n - num;
- }
- Console.Write(num + " ");
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement