Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Plane
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int widht = n * 3;
- int height = (n * 3) - (n / 2);
- char dot = '.';
- char stars = '*';
- int leftDost = (widht - 1) / 2;
- // first row
- Console.WriteLine("{0}{1}{0}",new string(dot,leftDost),new string (stars,1));
- // end first row
- // second row
- int secondOutDots = leftDost-1;
- int secondInnerDots = 1;
- int yellowRow = (n / 2) + 2;
- for (int i = 0; i <yellowRow; i++)
- {
- Console.WriteLine("{0}*{1}*{0}",
- new string(dot,secondOutDots), new string(dot, secondInnerDots));
- secondOutDots--;
- secondInnerDots += 2;
- }
- // end second
- // third row
- int redRow = n / 2 - 1;
- int thirdDots = n-4;
- int thirdInnerDots = secondInnerDots+2;
- for (int i = 0; i < redRow; i++)
- {
- Console.WriteLine("{0}*{1}*{0}",
- new string (dot,thirdDots),new string (dot,thirdInnerDots));
- thirdDots -= 2;
- thirdInnerDots += 4;
- }
- // end
- // four row
- Console.WriteLine("*{0}*{1}*{0}*",new string (dot,n-2),new string (dot,n));
- // end four
- // five row
- int fiveDots = n - 4;
- int fiveSecDots =1;
- for (int i = 0; i < redRow; i++)
- {
- Console.WriteLine("*{0}*{1}*{2}*{1}*{0}*",
- new string (dot,fiveDots),
- new string (dot,fiveSecDots),
- new string (dot,n));
- fiveDots -= 2;
- fiveSecDots+=2;
- }
- // end
- // six row
- int sixDots = n - 1;
- int innerSixDots = n;
- for (int i = 0; i < n-1; i++)
- {
- Console.WriteLine("{0}*{1}*{0}",
- new string(dot, sixDots), new string(dot, innerSixDots));
- sixDots--;
- innerSixDots += 2;
- }
- // end six
- Console.WriteLine("{0}",new string('*',widht));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement