int A ; int B; { if (A < 10) B=A; else if (A>10); A = B ...... <span style="font-family:KaiTi_GB2312;"> </span>}
<span style="font-family:KaiTi_GB2312;font-size:18px;"> Console.WriteLine("switch语句"); Console.WriteLine("请输入星期:"); string str=Console.ReadLine(); int i = Convert.ToInt32(str); switch (i) { case 1: Console.WriteLine("今天是星期{0}", i); break; case 2: Console.WriteLine("今天是星期{0}", i); break; case 3: Console.WriteLine("今天是星期{0}", i); break; case 4: Console.WriteLine("今天是星期{0}", i); break; ...... default: Console.WriteLine("你输入的数据{0}没有意义",i); break; } Console.ReadKey();</span>
<span style="font-family:KaiTi_GB2312;font-size:18px;"> int i; for (i = 1; i <= 10; ++i) { Console.WriteLine("{0}", i); } </span>
原文地址:http://blog.csdn.net/zhoukun1008/article/details/42061051