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 star
- {
- class Program
- {
- static void Main(string[] args)
- {
- /*
- int width = 10;
- int a = 0;
- int b = width / 2;
- int j = 1;
- while (a < width)
- {
- for (int i = 0; i < b; i++)
- {
- Console.Write(" ");
- }
- for (int h = 0; h < j; h++)
- {
- Console.Write("*");
- }
- Console.WriteLine();
- j += 2;
- a += 2;
- b -= 1;
- }
- */
- int width = 70;
- int topHeight = width / 6;
- int a = 0;
- int c = width / 2;
- int e = 1;
- while(a < topHeight)
- {
- for (int b = 0; b < c; b++)
- {
- Console.Write(" ");
- }
- for (int d = 0; d < e; d++)
- {
- Console.Write("*");
- }
- Console.WriteLine();
- c -= 1;
- e += 2;
- a += 1;
- }
- int f = 0;
- int h = 0;
- int j = width;
- int midHeight = width / 8;
- while(f < midHeight)
- {
- for(int g = 0; g < h; g++)
- {
- Console.Write(" ");
- }
- for(int i = 0; i < j; i++)
- {
- Console.Write("*");
- }
- Console.WriteLine();
- h += 2;
- j -= 4;
- f += 1;
- }
- int k = 0;
- int botHeight = width / 12;
- double m = midHeight * 2;
- double o = width - (midHeight * 4);
- while(k < botHeight)
- {
- for (int l = 0; l < m; l++)
- {
- Console.Write(" ");
- }
- for (int n = 0; n < o; n++)
- {
- Console.Write("*");
- }
- Console.WriteLine();
- m -= 0.5;
- o += 1;
- k += 1;
- }
- int p = 0;
- int legHeight = width / 6;
- double r = m;
- double t = width/2 - m -1;
- double v = 1;
- double x = width/2 - m -1;
- while(p < legHeight)
- {
- for (int q = 0; q < r; q++)
- {
- Console.Write(" ");
- }
- for (int s = 0; s < t; s++)
- {
- Console.Write("*");
- }
- for (int u = 0; u < v; u++)
- {
- Console.Write(" ");
- }
- for (int w = 0; w < x; w++)
- {
- Console.Write("*");
- }
- Console.WriteLine();
- r -= 0.5;
- t -= 2;
- v += 5;
- x -= 2;
- p += 1;
- }
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement