首页 > Windows开发 > 详细

C#笔记 三月三号 比较三个数字的大小

时间:2015-03-03 23:25:22      阅读:299      评论:0      收藏:0      [点我收藏+]
 1 namespace ConsoleApplication8
 2 {
 3     class Program
 4     {
 5         static void Main(string[] args)
 6         {
 7             Console.WriteLine("我可以帮你比较三个数字的大小,请输入第一个数字");
 8             int noone = Convert.ToInt32(Console.ReadLine());
 9             Console.WriteLine("请输入第二个数字");
10             int notwo = Convert.ToInt32(Console.ReadLine());
11             Console.WriteLine("请输入第三个数字");
12             int nothree = Convert.ToInt32(Console.ReadLine());
13 
14             if (noone > notwo)
15             {
16                 if (noone > nothree)
17                 {
18                     Console.WriteLine("当前最大的数字为{0}", noone);
19                 }
20                 else if (notwo < nothree)
21                 {
22                     Console.WriteLine("当前最大的数字为{0}", nothree);
23                 }
24 
25             }
26             else if (notwo > noone)
27             {
28                 if (notwo > nothree)
29                 {
30                     Console.WriteLine("当前最大的数字为{0}", notwo);
31                 }
32                 else if (nothree > noone)
33                 {
34                     Console.WriteLine("当前最大的数字为{0}", nothree);
35                 }
36             }
37             else if (nothree > noone)
38             {
39                 if (nothree > notwo)
40                 {
41                     Console.WriteLine("当前最大的数字为{0}", nothree);
42                 }
43                 else if (notwo > noone)
44                 {
45                     Console.WriteLine("当前最的的数字为{0}", notwo);
46                 }
47             }
48             Console.ReadKey();
49         }
50     }
51 }

 

C#笔记 三月三号 比较三个数字的大小

原文:http://www.cnblogs.com/flying-coder/p/4312046.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!