摘要:
foreach: foreach (int h in a) //可以将数组读出来(自动遍历数组) { Console.WriteLine(h); }等量代换:用一种量(或一种量的一部分)来代替和它相等的另一种量(或另一种量的一部分)。 //需要有个中间变量来倒 int a = 3, b = 5; i... 阅读全文
摘要:
穷举: 穷举法的基本思想是根据题目的部分条件确定答案的大致范围,并在此范围内对所有可能的情况逐一验证,直到全部情况验证完毕。若某个情况验证符合题目的全部条件,则为本问题的一个解;若全部情况验证后都不符合题目的全部条件,则本题无解。穷举法也称为枚举法。穷举练习: int n = 1; for (in... 阅读全文
摘要:
分支语句:if else if else; switch case--如何使用 if else if else: Console.WriteLine("请你出拳"); --输出【请你出拳】 int a = Convert.ToInt32(Console.ReadLine()); ... 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace 第二节课{ class Program { static ... 阅读全文