惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
D
Docker
Blog — PlanetScale
Blog — PlanetScale
罗磊的独立博客
美团技术团队
V
V2EX
Last Week in AI
Last Week in AI
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
Microsoft Security Blog
Microsoft Security Blog
Microsoft Azure Blog
Microsoft Azure Blog
人人都是产品经理
人人都是产品经理
M
MIT News - Artificial intelligence
P
Proofpoint News Feed
B
Blog RSS Feed
博客园_首页
B
Blog
博客园 - 叶小钗
I
InfoQ
WordPress大学
WordPress大学
L
LangChain Blog
Apple Machine Learning Research
Apple Machine Learning Research
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
A
About on SuperTechFans
The GitHub Blog
The GitHub Blog
The Register - Security
The Register - Security
MyScale Blog
MyScale Blog
云风的 BLOG
云风的 BLOG
博客园 - 司徒正美
Latest news
Latest news
W
WeLiveSecurity
T
The Exploit Database - CXSecurity.com
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
aimingoo的专栏
aimingoo的专栏
小众软件
小众软件
Cyberwarzone
Cyberwarzone
Scott Helme
Scott Helme
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
CERT Recently Published Vulnerability Notes
C
CXSECURITY Database RSS Feed - CXSecurity.com
Recent Commits to openclaw:main
Recent Commits to openclaw:main
N
News and Events Feed by Topic
S
Secure Thoughts
The Hacker News
The Hacker News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News

博客园 - 空军

过多边形边上某点的任意直线等分面积 VisualAPL Installer for Visual Studio 2008 [ZT] Create a Microsoft Access Database Using ADOX and Visual Basic .NET 数的分解,据说是清华的一道复试上机题 为System.Windows.Forms.FontDialog类添加Location属性 f(f(x)) = -x [zt]〖Math〗构造函数使得任意小的区间所对应的值域都是整个实数域 [zt]鸟巢、水立方:同一个地方,同一梦想 〖Math〗据传,任意锐角等于0° 爱因斯坦的超级问题(谁养鱼)SQL解法 “槑囧圐圙”您认得这些汉字吗? 根据URL提取页面的Title,根据网页的charset自动判断Encoding MSDN“MidpointRounding 枚举”中文翻译有误 表达式计算器 Google速记 Google中国编程挑战赛第一轮 Google中国编程挑战赛资格赛 数学家 数据库访问模块
C# 2.0 新特性(泛型、可空类型)应用一例
空军 · 2008-01-29 · via 博客园 - 空军

 1using System;
 2
 3class Test
 4{
 5  static void Main()
 6  {
 7    Console.WriteLine(Max(1));                               // 输出: 1
 8    Console.WriteLine(Max(.3-.5));                         // 输出: 0.3
 9    Console.WriteLine(Max(0M, -3M, 3.14M));                  // 输出: 3.14
10    Console.WriteLine(Max(9f, -1f, 3.14f-2.718f));         // 输出: 9
11    Console.WriteLine(Max(0u23u3114u120718u5678u));  // 输出: 120718
12  }

13
14  static T? Max<T>(params T[] x)
15  where T: struct, IComparable
16  {
17    if (x.Length == 0return null;
18    T a = x[0];
19    foreach (T i in x)
20      if (a.CompareTo(i) < 0) a = i;
21    return a;
22  }

23}

24