C#运算符小例子

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("输入一个数字:");
            int myInt = Convert.ToInt32(Console.ReadLine());
            bool isLessThan10 = myInt < 10;
            bool isBetween0And5 = (0 <= myInt) && (myInt <= 5);
            Console.WriteLine("数字小于10? {0}",isLessThan10);
            Console.WriteLine("数字在0和5之间? {0}", isBetween0And5);
            Console.ReadKey();
        }
    }
}

原文地址:https://www.cnblogs.com/jiqing9006/p/6707627.html