Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace NewHouseSolution
- {
- class NewHouseSolution
- {
- public static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- for(int i = 1; i <= n; i += 2)
- {
- int dashesCount = (n - i) / 2;
- string dashes = new string('-', dashesCount);
- string asterisks = new string('*', i);
- Console.Write(dashes);
- Console.Write(asterisks);
- Console.Write(dashes);
- Console.WriteLine();
- }
- for (int i = 1; i <= n; i++)
- {
- Console.WriteLine("{0}{1}{0}", "|", new string('*', (n - 2)));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment