mirror of
https://github.com/dotnet/skills.git
synced 2026-09-20 09:49:54 +08:00
14 lines
333 B
C#
14 lines
333 B
C#
namespace AssertionProblems;
|
|
|
|
public class Calculator
|
|
{
|
|
public int Add(int a, int b) => a + b;
|
|
public int Subtract(int a, int b) => a - b;
|
|
public int Multiply(int a, int b) => a * b;
|
|
public double Divide(int a, int b)
|
|
{
|
|
if (b == 0) throw new DivideByZeroException();
|
|
return (double)a / b;
|
|
}
|
|
}
|