kirililchev3

TriangleOfNumbers - for - for

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