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 ConsoleApplication
- {
- class Program
- {
- static void Main(string[] args)
- {
- string Line = Console.ReadLine();
- int n = int.Parse(Line);
- for (int i = 1; i <= n; i++)
- {
- if (i % 2 != 0)
- {
- for (int j = 1; 2*j < i; j++)
- {
- Console.Write(".");
- }
- Console.Write("*");
- for (int j = i; j < n; j++)
- {
- Console.Write("*");
- }
- for (int j = 1; 2 * j < i; j++)
- {
- Console.Write(".");
- }
- Console.WriteLine();
- }
- }
- for (int i = n - 1; i > 0; i--)
- {
- if (i % 2 != 0)
- {
- for (int j = 1; 2*j < i; j++)
- {
- Console.Write(".");
- }
- Console.Write("*");
- for (int j = i; j < n; j++)
- {
- Console.Write("*");
- }
- for (int j = 1; 2 * j < i; j++)
- {
- Console.Write(".");
- }
- Console.WriteLine();
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment