Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.70 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.  
  7. namespace Vezba_6
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.  
  14.             Console.WriteLine("Unesi broj redova");
  15.             var brRedova = System.Convert.ToInt32(Console.ReadLine());
  16.  
  17.             var brojac = 1;
  18.             for (var i = 1; i <= brRedova; i++)
  19.             {
  20.                 for (var j = 1; j <= i; j++)
  21.                 {
  22.                     Console.Write("{0} ", brojac);
  23.                     brojac++;
  24.                 }
  25.                 Console.WriteLine();
  26.             }
  27.  
  28.             Console.ReadKey();
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement