Synchronization of old projects
Part1
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
namespace Lesson13
|
||||
{
|
||||
class program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
#region 练习题一
|
||||
//求打印结果
|
||||
//Console.WriteLine(true || true); true
|
||||
//Console.WriteLine(false || true); true
|
||||
//Console.WriteLine(true && true); true
|
||||
//Console.WriteLine(true && false); false
|
||||
//Console.WriteLine(!true);false
|
||||
#endregion
|
||||
|
||||
#region 练习题二
|
||||
//求打印结果
|
||||
bool gameOver;
|
||||
bool isWin;
|
||||
int health = 100;
|
||||
gameOver = true;
|
||||
isWin = false;
|
||||
Console.WriteLine(gameOver || isWin && health > 0);//true
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user