Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Exam05Cup
- {
- class MainClass
- {
- public static void Main(string[] args)
- {
- int cupSize = int.Parse(Console.ReadLine());
- //upperPartOfTheCup
- int upperPartCountOfRows = cupSize / 2;
- int upperPartCountOfDots = cupSize;
- int upperPartCountOfHex = cupSize * 3;
- for (int i = 0; i < upperPartCountOfRows; i++)
- {
- Console.WriteLine("{0}{1}{0}",
- new string ('.', upperPartCountOfDots),
- new string ('#', upperPartCountOfHex));
- upperPartCountOfDots += 1;
- upperPartCountOfHex -= 2;
- }
- //secondPart
- int secondPartCountOfRows = cupSize / 2 + 1;
- int secondPartMiddleDots = cupSize * 2 - 2;
- int secondPartSideDots = upperPartCountOfDots;
- for (int i = 0; i < secondPartCountOfRows; i++)
- {
- Console.WriteLine("{0}#{1}#{0}",
- new string ('.', secondPartSideDots),
- new string ('.', secondPartMiddleDots));
- secondPartSideDots += 1;
- secondPartMiddleDots -= 2;
- }
- // thirdPart
- int thirdPartMiddleHashes = secondPartMiddleDots + 4;
- Console.WriteLine("{0}{1}{0}",
- new string ('.', secondPartSideDots - 1),
- new string ('#', thirdPartMiddleHashes));
- //fourthPart
- int fourthPartCountOfRows = cupSize / 2;
- for (int i = 0; i < fourthPartCountOfRows; i++)
- {
- Console.WriteLine("{0}{1}{0}",
- new string ('.', secondPartSideDots - 3),
- new string ('#', thirdPartMiddleHashes + 4));
- }
- //textpartumber of dots
- int textpartNumberOfDots = (cupSize * 5 - 10) / 2;
- Console.WriteLine("{0}D^A^N^C^E^{0}",
- new string ('.', textpartNumberOfDots));
- //lowerPart of cup
- int lowerParCountOfRows = cupSize / 2 + 1;
- for (int i = 0; i < lowerParCountOfRows; i++)
- {
- Console.WriteLine("{0}{1}{0}",
- new string ('.', secondPartSideDots - 3),
- new string ('#', thirdPartMiddleHashes + 4));
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment