bacco

Ромбче от звездички: Rhombus of Stars

Feb 9th, 2018
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.23 KB | None | 0 0
  1. using System;
  2.  
  3. namespace gt
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             var n = double.Parse(Console.ReadLine());
  10.  
  11.             for (int rolesUp = 1; rolesUp <= n; rolesUp++)
  12.                
  13.             {
  14.                
  15.                 for (int spaces = 0; spaces < n - rolesUp; spaces++)
  16.                    
  17.                 {
  18.                     Console.Write(" ");
  19.                 }
  20.                 for (int starsUp = 0; starsUp < rolesUp; starsUp++)
  21.                    
  22.                 {
  23.                     Console.Write("* ");
  24.  
  25.                 }
  26.                 Console.WriteLine();
  27.             }
  28.  
  29.             // DOWN........
  30.  
  31.             for (int rollesDown = 1; rollesDown <= n -1; rollesDown++)
  32.                
  33.             {
  34.                 for (int spacesDown = 0; spacesDown < rollesDown; spacesDown++)
  35.                    
  36.                 {
  37.                     Console.Write(" ");
  38.                 }
  39.                 for (int starsDown = 0 ; starsDown < n - rollesDown ; starsDown++)
  40.                    
  41.                 {
  42.                     Console.Write("* ");
  43.  
  44.                 }
  45.                 Console.WriteLine();
  46.             }
  47.         }
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment