Synchronization of old projects
Part1
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
|
||||
#region 练习题一
|
||||
//比较两个数的大小,求出最大的
|
||||
//int a = 10;
|
||||
//int b = 15;
|
||||
|
||||
//string str = a > b ? "a大于b" : "b大于等于a";
|
||||
//Console.WriteLine(str); // 输出:b大于等于a
|
||||
|
||||
Console.WriteLine("请输入两个数来比较大小");
|
||||
Console.WriteLine("请输入第一个数:");
|
||||
int a = int.Parse(Console.ReadLine());
|
||||
Console.WriteLine("请输入第二个数:");
|
||||
int b = int.Parse(Console.ReadLine());
|
||||
|
||||
string result = a > b ? "第一个数大于第二个数" : "第二个数大于等于第一个数";
|
||||
Console.WriteLine(result);
|
||||
#endregion
|
||||
Reference in New Issue
Block a user