Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Rock
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- int width = 3 * n;
- int height = 2 * n;
- char dot = '.';
- char star = '*';
- // first row
- Console.WriteLine("{0}{1}{0}",new string (dot,n),new string (star,n));
- // end first
- // second row
- int secondDots = n - 2;
- int secondInnerDots = n + 2;
- for (int i = 0; i < n/2; i++)
- {
- Console.WriteLine("{0}*{1}*{0}",
- new string(dot, secondDots),
- new string(dot, secondInnerDots));
- secondDots -= 2;
- secondInnerDots += 4;
- }
- // end second
- // third row
- Console.WriteLine("*{0}*{1}*{0}*",
- new string (dot,n-2),new string (dot,n));
- // end third
- // four row
- int fourDots = n-4;
- int fourInnerDots = 1;
- int fourUnchange = n;
- for (int i = 0; i < n/2-1; i++)
- {
- Console.WriteLine("*{0}*{1}*{2}*{1}*{0}*",
- new string(dot,fourDots),
- new string (dot,fourInnerDots),
- new string (dot,fourUnchange));
- fourDots -= 2;
- fourInnerDots += 2;
- }
- // end four
- // five row
- int fiveDots = n - 1;
- int fiveInner = n;
- for (int i = 0; i < n-1; i++)
- {
- Console.WriteLine("{0}*{1}*{0}",
- new string(dot, fiveDots), new string(dot, fiveInner));
- fiveDots--;
- fiveInner += 2;
- }
- // end five
- Console.WriteLine("{0}",new string (star,width));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment