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.RegularExpressions;
- /*Please dont change namespace, Dcoder
- and class must not be public*/
- //Compiler version 4.0, .NET Framework 4.5
- namespace Dcoder
- {
- public class Program
- {
- public static void Main(string[] args)
- {
- int n = Convert.ToInt32(Console.ReadLine());
- string[,] s = new string[n,n];
- string ss = "1";
- for (int i = 0; i < n - 1; i++)
- {
- ss = ss + " " + "2";
- }
- string[] sss = ss.Split(' ');
- for (int i = 0; i < n; i++)
- {
- for (int j = 0; j < n; j++)
- {
- s[i,j] = "0";
- }
- }
- for (int i = 0; i < n; i++)
- {
- int sum = 0;
- for (int j = n - 1 - i; j <= n - 1; j++)
- {
- s[i,j] = sss[sum];
- sum++;
- }
- }
- for (int i = 0; i < n; i++)
- {
- for (int j = 0; j < n; j++)
- {
- Console.Write(s[i, j] + " ");
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement