Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- public static void Main(string[] args)
- {
- int n2 = int.Parse(Console.ReadLine());
- Triangle(n2);
- }
- public static void PrintLine(int a,int b)
- {
- for (int i = a; i <=b ; i++)
- {
- Console.Write(i + " ");
- }
- Console.WriteLine();
- }
- public static void Triangle(int n)
- {
- for (int i = 1; i <=n; i++)
- {
- PrintLine(1, i);
- }
- for (int i = n-1; i >= 1; i--)
- {
- PrintLine(1, i);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement