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