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