if语句选择,可以单独使用,简单的if else组合.
if括号后面内判断条件,满足条件执行if下面的语句
namespace ConsoleApplication8 { class Program { static void Main(string[] args) { while (true) { int a; Console.Write("请输入一个整数:"); a = Convert.ToInt32(Console.ReadLine()); if (a>=10&&a<100) { Console.WriteLine("您输入的是两位的整数"); } else { if (a<10) { Console.WriteLine("您输入的数小于10"); } else { Console.WriteLine("您输入的数大于100"); } } } } } }