RenzCutie

InvertedTriangle

Sep 15th, 2022
75
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.  
  3. namespace Test
  4. {
  5.     static class Program
  6.     {
  7.         static void Main(String[] args)
  8.         {
  9.             Console.Write("Enter number of lines: ");
  10.             int input = Convert.ToInt32(Console.ReadLine());
  11.             int j = input;
  12.  
  13.             for (int i = 0; i < input; i++)
  14.             {
  15.                 for (int x = 0; x < j; x++)
  16.                 {
  17.                     Console.Write("{0} ", x + 1);
  18.                 }
  19.                 Console.WriteLine();
  20.                 j--;
  21.             }
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment