veronikaaa86

10. Triangle of Numbers

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