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 }
【推荐】博客园的心动:当一群程序员决定开源共建一个真诚相亲平台
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】Flutter适配HarmonyOS 5知识地图,实战解析+高频避坑指南
【推荐】凌霞软件回馈社区,携手博客园推出1Panel与Halo联合终身会员
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 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)