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;
- //Program wydaje mi się za długi i raczej powinien być podzielony na osobne funkcje
- //ale pewnie nie będziemy mogli tak pisać jeszcze w tym zadaniu.
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int linie;
- Console.WriteLine("Wprowadź wysokość : ");
- string str = Console.ReadLine();
- linie = Convert.ToInt32(str);
- int sum = linie - 1;
- for (int i = 0; i < linie; i++)
- {
- for (int j = 0; j < linie - i - 1; j++)
- {
- Console.Write(" ");
- }
- for (int x = 0; x < i * 2 + 1; x++)
- {
- Console.Write("*");
- }
- Console.WriteLine();
- }
- int e = 0;
- while (e!=2)
- {
- for (int c = 0; c < sum; c++)
- {
- Console.Write(" ");
- }
- Console.WriteLine("|"); e++;
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement