编写一个方法 不断要求用户输入两个数,直到其中一个为0,则结束

xiaoxiao2021-02-28  153

mubiao: //goto循环 意图无线循环 Console.WriteLine("请输入第一个数");//提示 string a = Console.ReadLine();//输入数字 int aa = Convert.ToInt32(a);//转换类型 Console.WriteLine("请输入第二个数");//提示 string b = Console.ReadLine();//输入数字 int bb = Convert.ToInt32(a);//转换类型 if (aa == 0 && bb == 0)//跳出条件 { return;//跳出 } goto mubiao; //goto循环 意图无线循环
转载请注明原文地址: https://www.6miu.com/read-34808.html

最新回复(0)