小编tmw*_*tmw的帖子

控制台应用代码错误

在我的代码中,

            int x;
            int y;
            x = 7;



            if (x == y)
            {
                Console.WriteLine("The numbers are the same!");

            }
            else
            {
                Console.WriteLine("The numbers are different.");
            }
            Console.ReadLine();


            for (int i = 0; i < y; i--)
            {
                Console.WriteLine("{0} sheep!", i);
            }
            Console.ReadLine();


            string[] colors = new string[y];
            colors[0] = "green";
            colors[1] = "yellow";
            colors[y] = "red";


            Console.WriteLine("Your new code is {0}.", Code(x, y));
            Console.ReadLine();

        }   

            static int Code(int myX, int myY)
            {
                int answer = myX * myX - myY; …
Run Code Online (Sandbox Code Playgroud)

c#

3
推荐指数
1
解决办法
132
查看次数

标签 统计

c# ×1