예제 #1
0
        static void Main(string[] args)
        {
            List<Warrior> warriors = new List<Warrior>();

            for (int i = 1; i <= 50; i++)
            {
                Duck duck = new Duck("Duck " + i.ToString(), 1);
                Ninja ninja = new Ninja("Ninja " + i.ToString(), 3);
                duck.SayName(duck.name);
                ninja.SayName(ninja.name);
                duck.Fight(duck.name, ninja.name, duck.hp, ninja.hp);
                ninja.Fight(ninja.name, duck.name, ninja.hp, duck.hp);
            }

            Console.ReadLine();
        }
예제 #2
0
        static void Main(string[] args)
        {
            Animal animal = new Animal();
            Duck duck = new Duck();

            duck.nNumbOfLegs = 2;

            BigInteger a = 1;
            BigInteger b = 1;
            BigInteger answer = 0;
            for(BigInteger x = 0; x<40000; x++)
            {
                BigInteger y = Fib(a,b);
                b = a;
                a = y;

                answer += y;
            }

            Console.WriteLine(answer);
            Console.Write(duck.nNumbOfLegs); //outputs the number of legs my duck has
            Console.Read(); //waits for input to keep the console up until keep pressed
        }