- 最後登錄
- 2022-2-18
- 在線時間
- 0 小時
- 註冊時間
- 2010-3-7
- 閱讀權限
- 20
- 精華
- 0
- UID
- 7741797
- 帖子
- 76
- 積分
- 193 點
- 潛水值
- 4402 米
| 只剩[3]可回答了,[1]的ORANK是什麼阿?我Google都找不到...- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Test2
- {
- internal class Program
- {
- private static void Main(string[] args)
- {
- //GetMax-1
- Console.WriteLine(GetMax(9, 98));
- //GetMax-2
- Console.WriteLine(GetMax(5, 6, 8, 100, 9487, 1, 2, 3, 4, 5, 6, 7, 8, 9));
- //GetMax-3
- Console.WriteLine(GetMax(new long[] { 16, 8765, 55688, 84 }));
- Console.ReadKey();
- }
- //GetMax-1
- private static int GetMax(int number1, int number2)
- {
- return (number1 > number2) ? number1 : number2;
- }
- //GetMax-2
- private static int GetMax(params int[] numbers)
- {
- return numbers.Max();
- }
- //GetMax-3
- private static long GetMax(long[] numbers)
- {
- return numbers.Max();
- }
- }
- }
複製代碼
... |
|