static void Main666(string[] args) { Console.WriteLine("输入分数:");
string fs = Console.ReadLine(); int score = Convert.ToInt32(fs); if (score < 60) { Console.WriteLine("是否认真做作业?(是,否)"); string zuoye = Console.ReadLine(); #region ======加分======= if (zuoye == "是") { score = score + 5; if (score < 60) { Console.WriteLine("不及格"); } else { Console.WriteLine("凑合及格"); } } else { Console.WriteLine("不及格了"); } #endregion } else { } Console.WriteLine("结束"); } static void Main222(string[] args) { Console.WriteLine("输入分数:"); string fs = Console.ReadLine(); int score = Convert.ToInt32(fs); #region 判断分数 if (score >= 0 && score < 60) { Console.WriteLine("不及格,补考"); } else if (score >= 60 && score < 80) { Console.WriteLine("恭喜及格"); } else if (score >= 80 && score <= 100) { Console.WriteLine("恭喜优秀"); } else { Console.WriteLine("输入有误"); } #endregion Console.WriteLine("结束"); } static void Main111(string[] args) { int a = 10; int b = 5; int c = (a++) + b; int d = (++a) + b; Console.WriteLine(a); Console.WriteLine(c); Console.WriteLine(d); } static void abc(string[] args) { Console.WriteLine("输入分数:"); string fs = Console.ReadLine(); int score = Convert.ToInt32(fs); if (score < 60) { Console.WriteLine("不及格,需要补考"); } Console.WriteLine("结束"); }
VS 复习,if...else if..else 和if..else的嵌套学习
原文:http://www.cnblogs.com/koker/p/5399547.html