aggressiveviking

Untitled

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