Advertisement
skipter

C# Fundamentals - Traingle of Numbers

Jun 3rd, 2017
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace ConsoleApp9
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             int n = int.Parse(Console.ReadLine());
  13.  
  14.             for (int row = 1; row <= n; row++)
  15.             {
  16.                 for (int col = 1; col <= row - 1; col++)
  17.                 {
  18.                     Console.Write(row + " ");
  19.                 }
  20.                 Console.WriteLine(row);
  21.             }
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement