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