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();
        }
    }
}

posted @ 2017-04-14 10:40  TBHacker  阅读(307)  评论(0编辑  收藏  举报