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 ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- {
- Console.BackgroundColor = ConsoleColor.DarkGray;
- Console.Clear();
- uint wysokość;
- Console.WriteLine("Podaj wysokość choinki");
- while (true)
- {
- if (uint.TryParse(Console.ReadLine(), out wysokość) == true) break;
- Console.WriteLine("Błędna liczba, spróbuj ponownie");
- }
- Console.ForegroundColor = ConsoleColor.Green;
- Console.Clear();
- for (uint u = 0; u < wysokość; ++u)
- {
- for (uint u1 = u; u1+1 < wysokość; ++u1)
- Console.Write(" ");
- for (uint u1 = 0; u1 <= 2*u; ++u1)
- {
- Console.Write("*");
- }
- Console.WriteLine();
- }
- Console.ForegroundColor = ConsoleColor.Magenta;
- for (uint u1 = 0 ; u1 + 1 < wysokość; ++u1){
- Console.Write(" ");
- }
- Console.WriteLine("|");
- for (uint u1 = 0; u1 + 1 < wysokość; ++u1)
- {
- Console.Write(" ");
- }
- Console.WriteLine("|");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement