> 文档中心 > C#逻辑运算

C#逻辑运算

using System;namespace demo_01{    class Program    { static void Main(string[] args) {     //声明三个布尔变量 真  假  真     bool a = true;     bool b = false;     bool c = true;     //输出或且非逻辑     Console.WriteLine(a || b);     Console.WriteLine(a || c);     Console.WriteLine(a && b);     Console.WriteLine(a && c);     Console.WriteLine(! a);     Console.WriteLine(! b);     //阻塞一下cmd消失    查看结果     Console.Read();      }    }}

打开cmd 查看期望值
C#逻辑运算