添加Lesson19

This commit is contained in:
2025-10-23 21:00:25 +08:00
parent f77c10f1d5
commit 0fa8be7459
5 changed files with 139 additions and 0 deletions
@@ -0,0 +1,34 @@
#define Unity2017
#define Unity2020
namespace Lesson19_预处理器指令练习
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("请输入第一个数字:");
int a = int.Parse(Console.ReadLine());
Console.WriteLine("请输入第二个数字:");
int b = int.Parse(Console.ReadLine());
Console.WriteLine(Calc(a, b));
}
static int Calc(int a, int b)
{
#if Unity5
return a + b;
#elif Unity2017
return a*b;
#elif Unity2019
return a-b;
#else
return 0;
#endif
}
}
}