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