mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-19 18:16:06 +00:00
Initial Commit
This commit is contained in:
1 parent
13d2051bab
commit
eb8b118d62
22 files changed
+1388
-3
No files matched your search
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
|
||||
namespace TestProject
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Hello, World!");
|
||||
|
||||
var calculator = new Calculator();
|
||||
int result = calculator.Add(5, 3);
|
||||
Console.WriteLine($"5 + 3 = {result}");
|
||||
}
|
||||
}
|
||||
|
||||
public class Calculator
|
||||
{
|
||||
public int Add(int a, int b)
|
||||
{
|
||||
return a + b;
|
||||
}
|
||||
|
||||
public int Subtract(int a, int b)
|
||||
{
|
||||
return a - b;
|
||||
}
|
||||
|
||||
public int Multiply(int a, int b)
|
||||
{
|
||||
return a * b;
|
||||
}
|
||||
|
||||
public double Divide(int a, int b)
|
||||
{
|
||||
if (b == 0)
|
||||
{
|
||||
throw new DivideByZeroException("Cannot divide by zero");
|
||||
}
|
||||
return (double)a / b;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user