Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace LiveDemo
- {
- class Program
- {
- static void Main(string[] args)
- {
- int size = int.Parse(Console.ReadLine());
- string emptySpace = " ";
- string asterisk = "*";
- int firstPartRows = size;
- for (int currentRow = 1; currentRow <= firstPartRows; currentRow++)
- {
- for (int currentWhiteSpace = 0; currentWhiteSpace < size - currentRow; currentWhiteSpace++)
- {
- Console.Write(emptySpace);
- }
- Console.Write(asterisk);
- for (int currentCombination = 0; currentCombination < currentRow - 1; currentCombination++)
- {
- Console.Write(emptySpace + asterisk);
- }
- Console.WriteLine();
- }
- int secondPartRows = size - 1;
- for (int currentRow = secondPartRows; currentRow > 0; currentRow--)
- {
- for (int currentEmptySpace = 0; currentEmptySpace < size - currentRow; currentEmptySpace++)
- {
- Console.Write(emptySpace);
- }
- Console.Write(asterisk);
- for (int currentCombination = 0; currentCombination < currentRow - 1; currentCombination++)
- {
- Console.Write(emptySpace + asterisk);
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement