Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace _3.NewHouse
- {
- using System;
- public class DrawingNewHouse
- {
- public static void Main(string[] args)
- {
- checked
- {
- int width = int.Parse(Console.ReadLine());
- string asterisksSeq = string.Empty;
- for (int i = 1; i <= width; i += 2)
- {
- asterisksSeq = new string('*', i);
- string dashSeq = new string('-', (width - i) / 2);
- Console.WriteLine("{0}{1}{0}", dashSeq, asterisksSeq);
- }
- for (int j = 0; j < width; j++)
- {
- asterisksSeq = new string('*', width - 2);
- Console.WriteLine("{0}{1}{0}", '|', asterisksSeq);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement