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 ShapesWithLoops
- {
- class Program
- {
- static void Main(string[] args)
- {
- int length;
- length = int.Parse(Console.ReadLine());
- for (int i = 0; i < length; i++)
- Console.WriteLine("*****");
- Console.WriteLine("\n");
- for (int i = 0; i < length; i++)
- {
- if (i == 0 || i == length - 1)
- Console.WriteLine("*****");
- else
- Console.WriteLine("* *");
- }
- Console.WriteLine("\n");
- for (int i = 0; i < length; i++)
- {
- for(int a = length - (i+1); a>=0; a--)
- Console.Write(" ");
- for (int b = 0; b <= i; b++)
- Console.Write("*");
- Console.WriteLine();
- }
- Console.WriteLine("\n");
- for (int i = 0; i < length; i++)
- {
- for (int a = length - (i + 1); a >= 0; a--)
- Console.Write(" ");
- if (i == length - 1 || i == 0)
- {
- for (int b = 0; b <= i; b++)
- Console.Write("*");
- }
- else
- {
- Console.Write("*");
- for (int c = 1; c < i; c++)
- Console.Write(" ");
- Console.Write("*");
- }
- Console.WriteLine();
- }
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement