vojta249

Maturita_12 - pyramida

Mar 28th, 2022 (edited)
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Program
  4. {
  5.     internal class Program
  6.     {
  7.         public static void Main(string[] args)
  8.         {
  9.             Console.WriteLine("Zadejte počet řádků");
  10.             int radky = int.Parse(Console.ReadLine());
  11.             for (int i = 1; i <= radky; i++)
  12.             {
  13.                 for (int k = 0; k < radky - i; k++)
  14.                 {
  15.                     Console.Write(" ");
  16.                 }
  17.  
  18.                 for (int j = 0; j < 2 * i - 1; j++)
  19.                 {
  20.                     Console.Write("*");
  21.                 }
  22.  
  23.                 Console.WriteLine();
  24.             }
  25.  
  26.             Console.ReadKey();
  27.         }
  28.     }
  29. }
Add Comment
Please, Sign In to add comment