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 _05.Пеперуда
- {
- class Program
- {
- static void TopPartOfButterFly(int n)
- {
- int stars = n - 2;
- int space=1;
- int backslash;
- int line= n - 2;
- for (int i = 0; i < (n-2)/2; i++)
- {
- Console.WriteLine("{0}\\{1}/{0}", new string('*', stars), new string(' ', space));
- Console.WriteLine("{0}\\{1}/{0}", new string('-', line), new string(' ', space));
- }
- }
- static void MiddlePartOfButterFly(int n)
- {
- int stars = n - 2;
- int space = n - 2;
- Console.WriteLine("{0}\\{1}/{0}", new string('*', stars), new string(' ', 1));
- Console.WriteLine("{0}@{0}", new string(' ', space+1), new string(' ', 1));
- Console.WriteLine("{0}/{1}\\{0}", new string('*', stars), new string(' ', 1));
- }
- static void BottomPartOfButterFly(int n)
- {
- int stars = n - 2;
- int space = 1;
- int line = n - 2;
- for (int i = 0; i < (n - 2) / 2; i++)
- {
- Console.WriteLine("{0}/{1}\\{0}", new string('-', line), new string(' ', space));
- Console.WriteLine("{0}/{1}\\{0}", new string('*', stars), new string(' ', space));
- }
- }
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- TopPartOfButterFly(n);
- MiddlePartOfButterFly(n);
- BottomPartOfButterFly(n);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement