示例#1
0
        static void Main(string[] args)
        {
            var obj  = SingleTone.SingleTone_Instance();
            var obj1 = SingleTone.SingleTone_Instance();
            var obj2 = SingleTone.SingleTone_Instance();

            if (obj == obj1 && obj == obj2)
            {
                Console.WriteLine("Same Object");
            }
            Program p = new Program();

            p.Display();
            CallaA A    = new CallaA();
            var    aaaa = A.Add(1);
            //var aa= obj.Add(1);
            //Console.WriteLine("Singletone Object"+aa.ToString());
        }
示例#2
0
        static void Main(string[] args)
        {
            int userNumber = 0;

            Console.Write("Iveskite eiluciu skaiciu: ");
            userNumber = Convert.ToInt32(Console.ReadLine());
            int cursorPositionX = userNumber;
            int cursorPositionY = userNumber;

            Console.Clear();
            for (int i = 0; i < userNumber; i++)
            {
                for (int a = 0; a < i + 1; a = a + 1)
                {
                    Program p = new Program();
                    p.Display(cursorPositionY, i, "*");
                    cursorPositionY = cursorPositionY + 2;
                }
                cursorPositionY = cursorPositionX - 1;
                cursorPositionX = cursorPositionY;
            }
            Console.ReadLine();
        }