Advertisement
Spocoman

08. Triangle of Numbers

Jan 12th, 2022
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.43 KB | None | 0 0
  1. using System;
  2.  
  3. namespace TriangleOfNumbers
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.  
  11.             for (int i = 1; i <= n; i++)
  12.             {
  13.                 for (int j = 0; j < i; j++)
  14.                 {
  15.                     Console.Write($"{i} ");
  16.                 }
  17.                 Console.WriteLine();
  18.             }
  19.         }
  20.     }
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement