Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Rextester.Program.Main is the entry point for your code. Don't change it.
- //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text.RegularExpressions;
- namespace Rextester
- {
- public class Program
- {
- const char CHAR = '*';
- static void Star() {Console.Write(CHAR);}
- static void Starno() {Console.Write('◈');}
- static void StarLn() { Console.WriteLine(CHAR); }
- static void Space() { Console.Write(" ");}
- static void SpaceLn() { Console.WriteLine(" ");}
- static void NewLine() { Console.WriteLine();}
- public static void LiteraX(int n)
- {
- if (n < 3) throw new ArgumentException("zbyt mały rozmiar");
- if (n % 2 == 0) n = n + 1;
- //górna połówka
- for (int i = 0; i < n-1 ; i++)
- {
- Star();
- for (int j = 2; j < n - i; j++)
- {
- Space();
- }
- Star();
- for (int j = i+2; j > 2 ; j--)
- {
- Space();
- }
- StarLn();
- }
- }
- public static void Main(string[] args)
- {
- LiteraX(18);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement