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

复制代码
 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 }
复制代码

 

posted @ 2015-03-03 22:18  程序飞行猿  阅读(1417)  评论(0)    收藏  举报
编辑推荐:
· tomcat为什么假死了
· 聊一聊 Linux 上对函数进行 hook 的两种方式
· C# 锁机制全景与高效实践:从 Monitor 到 .NET 9 全新 Lock
· 一则复杂 SQL 改写后有感
· golang中写个字符串遍历谁不会?且看我如何提升 50 倍
阅读排行:
· 完成微博外链备案,微博中直接可以打开园子的链接
· C# WinForms 实现打印监听组件
· 推荐 3 种 .NET Windows 桌面应用程序自动更新解决方案
· 一个基于 .NET 开源、模块化 AI 图像生成 Web 用户界面
· .NET 10 支持Linux/Unix 的Shebang(Hashbang)
点击右上角即可分享
微信分享提示