c#的输入不熟,求指导,为什么b输入不了

            int a, b, sum;

            Console.WriteLine("请输入第一个数字:");

            a = Console.Read();

            Console.WriteLine("请输入第二个数字:");

            b = Console.Read();

            sum = a + b;

            Console.WriteLine("两个数的和是:" + sum);


残雨無痕
浏览 1042回答 1
1回答

Cong聪

                 int a = 0, b = 0, sum;                Console.WriteLine("请输入第一个数字:");                a = Convert.ToInt32(Console.ReadLine());                Console.WriteLine("请输入第二个数字:");                b = Convert.ToInt32(Console.ReadLine());                sum = a + b;                Console.WriteLine("两个数的和是:" + sum);输入后需要换行,才能输出内容

慕瓜9220888

QRAGSXIPMISIOHOFSJQKQJZDEBRGHGMSPTKKEPLKQTTAEBWBHXZQKVTOKDUSFGNSKJYDHHUFCNOBQUQGOJOUXZNKUQPNDJVPGWQVQQZLPSTZXSZYXCPZUORQGICGKRUXJPBZIJKNSIILZQKUMHPFBVCWUBIBKTKGQRZEDWZJWNNXSLOHRIKLTLKJVZWXVRTCSOZJJKYJITFWXHOLKAAWTCTDMNJIYCFSZAEENJDOOIHPOLYPZCWCNJVVIILMUADZMZAXVMXMCOPZPMFAPLYVZNKOPEUKKBIPMHQHFQKBIDCYBHLLIJTUATFVMMWGXDDXEFPMHAGMFZMQRSXADASGAKZLLRQXXYFLACPYSJQAGEKAJWXHICUQGQCCDUBPFVKIKAEYWIEDECWGTUTJYZAEUEZPVHBCWWBJOXRTGUKWRTDCCDNGFXXKXDBIPEPNZIWNCKBVLODEFAFHLHXGXCFGZTZSBFTNRRCEWPXNSGXZYEGBFFYACKQMTHODURGTFWGKLXPZLEIFDASXOEREBIPSGPIRVFCYDOXPVSCZQCDDSCHOZTMDMIICJNAXMEATNKVLGBCVYIJPQSNPNCWHHYRYRHQXEPEPQZPUYJQUMHMZOSTDRNRXWCTQKBIJZCUBSZXXIVXDXYSSGWMIHCMCKTEUYHOSJPRTZIEJABFGRJCCZPQDTEGXQXBIJWKKSMPGBIWYDFBVZXNAPEKAUOTLHCYXNKEWDRCSSZXMEVG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