Advertisement
filipovv

triangle of numbers

May 31st, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | None | 0 0
  1. using System;
  2.  
  3. namespace TriangleOfNums
  4. {
  5.     class MainClass
  6.     {
  7.         public 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 = 1; j <= i; j++)
  14.                 {
  15.                     Console.Write(i);
  16.                     Console.Write(' ');
  17.                 }
  18.                 Console.WriteLine();
  19.             }
  20.  
  21.  
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement