C#学习记录

来源:互联网 发布:linux 解压tar 编辑:程序博客网 时间:2024/05/20 20:02
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Enter an integer:");         //控制台显示的字段
            int myInt = Convert.ToInt32(Console.ReadLine());//转格式
            bool isLessThan10 = myInt < 10;                 
            bool isBetween0And5 = (0 <= myInt) && (myInt <= 5);  //声明布尔变量并赋值
            Console.WriteLine("Integer less than 10?{0}", isLessThan10);
            Console.WriteLine("Integer between 0 and 5?{0}", isBetween0And5);
            Console.WriteLine("Exactly one of the above is ture?{0}", isLessThan10 ^ isBetween0And5);
            Console.ReadKey();
        }
    }
}
0 0
原创粉丝点击