c#随机输入三个数,输出最小值
1、首先在第一行输入代码,表示输出

2、接下来我们输入三行代码,你输入的值在这里进行转换。
int a = int.Parse (Console.ReadLine ());int b = int.Parse (Console.ReadLine ());int c = int.Parse (Console.ReadLine ());

3、接下来我们就用到了if,这里表示如果的意思。
if (a < b && a < c) { Console.WriteLine (a); }if (b < a && b < c) { Console.WriteLine (b); }if (c < a && c < b) { Console.WriteLine (c); }

4、现在我们开始运行,CTRL+F5,接下来我们在控制台上随便输入3个数。例如
:60,50,40.我们可以看到输出了40,表示我们运行成功了。

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:58
阅读量:59
阅读量:127
阅读量:29
阅读量:77