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 ConsoleApplication6
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("Write x: ");
- int i;
- int j;
- int k;
- int x = Convert.ToInt32(Console.ReadLine());
- i = 0;
- while(i < x)
- {
- k = 0;
- while(k < x - 1 - i)
- {
- Console.Write(" ");
- k++;
- }
- j = 0;
- while(j <= 2 * i)
- {
- Console.Write("* ");
- j++;
- }
- Console.WriteLine();
- i++;
- }
- i = 0;
- while (i < x)
- {
- k = 0;
- while (k < x - 1 - i)
- {
- Console.Write(" ");
- k++;
- }
- j = 0;
- while (j <= 2 * i)
- {
- Console.Write("* ");
- j++;
- }
- Console.WriteLine();
- i++;
- }
- i = 0;
- while (i < x)
- {
- k = 0;
- while (k < x - 1 - i)
- {
- Console.Write(" ");
- k++;
- }
- j = 0;
- while (j <= 2 * i)
- {
- Console.Write("* ");
- j++;
- }
- Console.WriteLine();
- i++;
- }
- i = 0;
- while (i < x)
- {
- k = 0;
- while(k < x - 2)
- {
- Console.Write(" ");
- k++;
- }
- j = 0;
- while (j < x - 2)
- {
- Console.Write("* ");
- j++;
- }
- Console.WriteLine();
- i++;
- }
- Console.WriteLine("Press SPACE to EXIT");
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment