Advertisement
Adijata

Prva vježba 2013 RPR drugi zadatak

Oct 9th, 2014
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 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 ConsoleApplication7
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.            
  14.             Console.WriteLine("Unesite broj redova zvjezde: ");
  15.             int n = int.Parse(Console.ReadLine());            
  16.             for (int i = 1; i <= n; i++)
  17.             {
  18.                 for (int j = -1; j <= n * 2+1;  j++)
  19.                 {
  20.  
  21.                     if (j <= n / 2 - i || j >= n / 2 + i) Console.Write(" ");
  22.                     else Console.Write("*");
  23.                 }  
  24.                 Console.Write("\n");
  25.             }
  26.             Console.ReadLine();
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement