Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _03.Task3
- {
- class DressPattern
- {
- static void TopPartOfDress(int n)
- {
- int underscore;
- int stars = 2;
- underscore = (12 * n) / 3;
- Console.WriteLine("{0}.{0}.{0}",new string('_',underscore));
- for (int row = 0; row < 3*n-1; row++)
- {
- if (underscore==2)
- {
- break;
- }
- underscore -= 2;
- Console.WriteLine("{0}.{1}.{0}.{1}.{0}", new string('_', underscore),new string('*', stars));
- stars += 3;
- }
- Console.WriteLine(".{0}..{0}.", new string('*', stars));
- }
- static void MiddlePartOfDress(int n)
- {
- int dot = 3 * n;
- int underscore;
- underscore = (12 * n);
- for (int i = 0; i < n; i++)
- {
- Console.WriteLine(".{0}.", new string('*', underscore));
- }
- underscore = (12 * n + 2) - 2 * dot;
- Console.WriteLine("{0}{1}{0}", new string('.', dot), new string('*', underscore));
- }
- static void BottomPartOfDress(int n)
- {
- int dot = 3 * n;
- int underscore = 3 * n;
- int letter = (12 * n + 2) - 2 * underscore;
- for (int i = 0; i < n; i++)
- {
- Console.WriteLine("{0}{1}{0}", new string('_', underscore), new string('o', letter));
- }
- underscore = 3 * n;
- int stars = (12 * n ) - 2 * underscore;
- for (int i = 0; i < 3 * n; i++)
- {
- Console.WriteLine("{0}.{1}.{0}", new string('_', underscore), new string('*', stars));
- underscore--;
- stars+=2;
- }
- Console.WriteLine(new string('.', 12 * n + 2));
- }
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- TopPartOfDress(n);
- MiddlePartOfDress(n);
- BottomPartOfDress(n);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement