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;
- namespace Task03
- {
- class Task03
- {
- static void Main(string[] args)
- {
- byte n = byte.Parse(Console.ReadLine());
- int pad = 2 * n;
- string [,] trapezoid = new string[(n+1),(n*2)];
- for (int i = 0; i < trapezoid.GetLength(0); i++)
- {
- for (int j = 0; j < trapezoid.GetLength(1); j++)
- {
- if (i == n)
- {
- trapezoid[i, j] = "*";
- }
- else if (i == 0 && j >= n)
- {
- trapezoid[i, j] = "*";
- }
- else
- {
- trapezoid[i, j] = ".";
- trapezoid[i, n - i] = "*";
- trapezoid[i, (2 * n)-1] = "*";
- }
- }
- }
- for (int i = 0; i < trapezoid.GetLength(0); i++)
- {
- for (int j = 0; j < trapezoid.GetLength(1); j++)
- {
- Console.Write(trapezoid[i, j]);
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment