Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main(string[] args)
- {
- int N = int.Parse(Console.ReadLine());
- int left = 0;
- int right = N+1;
- for (int f = 1; f <= N; f++) {
- if(f < N/2 + 1){
- for (int a = 1; a <= N; a++) {
- if (a <= left || a >= right) {
- Console.Write(".");
- }
- else {
- Console.Write("*");
- }
- }
- left++;
- right--;
- Console.WriteLine();
- }else{
- for (int b = 1; b <= N; b++) {
- if (b <= left || b >= right) {
- Console.Write(".");
- }
- else {
- Console.Write("*");
- }
- }
- left--;
- right++;
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement