27 lines
742 B
C#
27 lines
742 B
C#
|
|
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
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|