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