Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int n = int.Parse(Console.ReadLine());
- string topRowsLabel = "{0}\\ /{0}";
- int symbolCount = n - 2;
- for (int i = 0; i < symbolCount; i++)
- {
- string row = string.Empty;
- if (i % 2 == 0)
- {
- row = string.Format(topRowsLabel, new string('*', symbolCount));
- }
- else
- {
- row = string.Format(topRowsLabel, new string('-', symbolCount));
- }
- Console.WriteLine(row);
- }
- Console.WriteLine(new string(' ', n - 1) + "@");
- string botRowsLabel = "{0}/ \\{0}";
- for (int i = 0; i < symbolCount; i++)
- {
- string row = string.Empty;
- if (i % 2 == 0)
- {
- row = string.Format(botRowsLabel, new string('*', symbolCount));
- }
- else
- {
- row = string.Format(botRowsLabel, new string('-', symbolCount));
- }
- Console.WriteLine(row);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement