35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
|
|
using System;
|
|||
|
|
namespace Lesson12_练习题
|
|||
|
|
{
|
|||
|
|
class Program
|
|||
|
|
{
|
|||
|
|
static void Main(string[] args)
|
|||
|
|
{
|
|||
|
|
#region 口算
|
|||
|
|
//请回答一下问题:
|
|||
|
|
//我的年龄(18)>你们的年龄(22)false
|
|||
|
|
//兔子的速度(3m/s)<乌龟的速度(1m/s)false
|
|||
|
|
//狗的重量(50kg)<兔子的重量(2kg)false
|
|||
|
|
//我有钱(10元)==你有钱(10元)true
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region 求打印结果
|
|||
|
|
//bool b = true;
|
|||
|
|
//console.WriteLine(b != true); false
|
|||
|
|
//console.WriteLine(10==10); ture
|
|||
|
|
//console.WriteLine(10 > 20); false
|
|||
|
|
//console.WriteLine(10 <= 20); true
|
|||
|
|
//console.WriteLine(10 <= 10); true
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region 综合练习
|
|||
|
|
//bool gameOver,startGame;
|
|||
|
|
//int a = 10,b = 15;
|
|||
|
|
//gameOver = a > (b - 5);
|
|||
|
|
//startGame = gameOver == (b > (a + 5));
|
|||
|
|
//console.WriteLine("stratGame = " + startGame);
|
|||
|
|
//true
|
|||
|
|
#endregion
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|