using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 第六天_for循环的嵌套 { class Program { static void Main(string[] args) { int num01; int num02; ; num01 <= ; num01++) { ; num02 <= n…
for TAB  和 forr TAB using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 第六天_do_while循环 { class Program { static void Main(string[] args) { ; i <= ; i++) { ; /; ; if (bai*bai*ba…
For循环:专门处理已知循环次数的循环.  小技巧:连续敲击两下TAB键循环体自动搭建完成. For循环语法: for(表达式1;表达式2;表达式3){ 循环体;}表达式1一般为声明循环变量,记录循环的次数(int i=0;)表达式2一般为循环条件(i<10)表达式3一般为改变循环条件的代码,使循环条件终有一天不再成立(i++). For循环执行过程: 程序首先执行表达式1,声明了一个循环变量用来记录循环的次数,然后执行表达式2,判断循环条件是否成立,如果表达式2返回的结果为true,则执行循环…
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 第六天_do_while循环 { class Program { static void Main(string[] args) { string answer = ""; while (answer != "q")…
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 第六天_do_while循环 { class Program { static void Main(string[] args) { Console.WriteLine("老师我唱的您满意吗?"); string answer = Con…
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 第六天_流程语句 { class Program { static void Main(string[] args) { bool b = true; //让代码满足某些条件的时候才去执行 ; ; i <=; i++) { Console.Writ…
类型转换:Convert.ToInt32();  int.Parse();  int.TryParse(); Convert.ToInt32(); 的本质就是在使用 int.Parse(); int.TryParse();尝试着将一个字符串转换成int类型.作为一种方法.方法:需要参数和输入返回值.  返回值失败为0.…
1.常量: 声明的常量的语法:const 变量类型 变量名=值;最大的特点就是,声明了常量后,就不能再被重新赋值. 2.枚举 语法:[public] enum 枚举名{ 值1, 值2, 值3, ........}public:访问修饰符.公开的公共的,哪都可以访问.enum:关键字,声明枚举的关键字枚举名:要符合Pascal命名规范 enum枚举在main()函数中不能使用,所以将枚举声明到命名空间的下面,类的外面,表示这个命名空间下,所有的类都可以使用这个枚举. 枚举就是一个变量类型 ,int…
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 第六天_流程语句 { class Program { static void Main(string[] args) { Random r = new Random(); //1.创建一个能产生随机数的对象 while (true) { , );…
三元表达式语法: 表达式1?表达式2:表达式3; 表达式1一般为一个关系表达式.如果表达式1的值为true,那么表达式2的值就是整个三元表达式的值.如果表达式1的值为false,那么表达式3的值就是整个三元表达式的值. 注意:表达式2的结果类型必须跟表达式3的结果类型一致,并且也要跟整个三元表达式的结果类型一致. 凡是可以使用if-else做的事情,都可以使用三元表达式来完成. using System; using System.Collections.Generic; using Syste…