Initial commit: C# 学习笔记和示例代码
- Lesson 01-10: C# 基础语法 - WebView2: 集成示例 - notes/: 详细笔记
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
|
||||
namespace Lesson05.Helpers
|
||||
{
|
||||
static class MathHelper
|
||||
{
|
||||
public static int Add(int a, int b)
|
||||
{
|
||||
return a + b;
|
||||
}
|
||||
|
||||
public static int Multiply(int a, int b)
|
||||
{
|
||||
return a * b;
|
||||
}
|
||||
|
||||
public static double Divide(int a, int b)
|
||||
{
|
||||
if (b == 0)
|
||||
{
|
||||
Console.WriteLine("除数不能为0!");
|
||||
return 0;
|
||||
}
|
||||
return (double)a / b;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user