Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System; romb ot zvezdi
- public class Program
- {
- public static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- int numberSpaces = n-1;
- //gorna chast
- for (int row = 1; row <= n; row++)
- {
- Console.Write(new string(' ', numberSpaces));
- Console.Write('*');
- if(row>1)
- {
- for (int col = 1; col < row; col++)
- {
- Console.Write(" *");
- }
- }
- numberSpaces-=1;
- Console.WriteLine();
- }
- //dolna chast
- int numSpaces = 1;
- for (int row = n - 1; row >= 1; row--)
- {
- Console.Write(new string(' ',numSpaces));
- Console.Write('*');
- int number = n-2;
- for(int col = 1; col < row; col++)
- {
- Console.Write(" *");
- }
- numSpaces++;
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement