Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class PlaidTowel
- {
- static void Main()
- {
- int number = int.Parse(Console.ReadLine());
- char oneSym = char.Parse(Console.ReadLine());
- char twoSym = char.Parse(Console.ReadLine());
- int width = number * 4 + 1;
- // first row
- Console.WriteLine("{0}{1}{2}{1}{0}", new string(oneSym, number), new string(twoSym, 1), new string(oneSym, width / 2 - 1));
- // end first row
- // second
- int firstDots = number - 1;
- int firstSecondDots = 1;
- int firstThreeDots = (number * 4 + 1) - 4 - (2 * number);
- for (int i = 0; i < number - 1; i++)
- {
- Console.WriteLine("{0}{1}{2}{1}{3}{1}{2}{1}{0}", new string(oneSym, firstDots), new string(twoSym, 1), new string(oneSym, firstSecondDots), new string(oneSym, firstThreeDots));
- firstDots--;
- firstSecondDots += 2;
- firstThreeDots -= 2;
- }
- // end second
- // three
- Console.WriteLine("{0}{1}{0}{1}{0}", new string(twoSym, 1), new string(oneSym, width / 2 - 1));
- // end three
- // four
- for (int i = 0; i < number - 1; i++)
- {
- firstDots++;
- firstSecondDots -= 2;
- firstThreeDots += 2;
- Console.WriteLine("{0}{1}{2}{1}{3}{1}{2}{1}{0}", new string(oneSym, firstDots), new string(twoSym, 1), new string(oneSym, firstSecondDots), new string(oneSym, firstThreeDots));
- }
- Console.WriteLine("{0}{1}{2}{1}{0}", new string(oneSym, number), new string(twoSym, 1), new string(oneSym, width / 2 - 1));
- int twoDots = number - 1;
- int twoSecondDots = 1;
- int twoThreeDots = (number * 4 + 1) - 4 - (2 * number);
- for (int i = 0; i < number - 1; i++)
- {
- Console.WriteLine("{0}{1}{2}{1}{3}{1}{2}{1}{0}", new string(oneSym, twoDots), new string(twoSym, 1), new string(oneSym, twoSecondDots), new string(oneSym, twoThreeDots));
- twoDots--;
- twoSecondDots += 2;
- twoThreeDots -= 2;
- }
- // end second
- // three
- Console.WriteLine("{0}{1}{0}{1}{0}", new string(twoSym, 1), new string(oneSym, width / 2 - 1));
- // end three
- // four
- for (int i = 0; i < number - 1; i++)
- {
- twoDots++;
- twoSecondDots -= 2;
- twoThreeDots += 2;
- Console.WriteLine("{0}{1}{2}{1}{3}{1}{2}{1}{0}", new string(oneSym, twoDots), new string(twoSym, 1), new string(oneSym, twoSecondDots), new string(oneSym, twoThreeDots));
- }
- Console.WriteLine("{0}{1}{2}{1}{0}", new string(oneSym, number), new string(twoSym, 1), new string(oneSym, width / 2 - 1));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement