From 44a8ed999cd3787950c9f61ca352470f93808d2a Mon Sep 17 00:00:00 2001 From: wizardforcel <562826179@qq.com> Date: Thu, 9 Jul 2020 20:48:39 +0800 Subject: [PATCH] 2020-07-09 20:48:39 --- docs/csharp/11.md | 6 +++--- docs/csharp/12.md | 4 ++-- docs/csharp/13.md | 2 +- docs/csharp/14.md | 2 +- docs/csharp/15.md | 2 +- docs/csharp/20.md | 8 ++++---- docs/csharp/21.md | 2 +- docs/csharp/3.md | 2 +- docs/csharp/4.md | 2 +- docs/csharp/5.md | 2 +- docs/csharp/6.md | 4 ++-- docs/csharp/7.md | 14 +++++++------- docs/csharp/8.md | 8 ++++---- docs/csharp/9.md | 4 ++-- 14 files changed, 31 insertions(+), 31 deletions(-) diff --git a/docs/csharp/11.md b/docs/csharp/11.md index 2bbf0b9..e2e6e78 100644 --- a/docs/csharp/11.md +++ b/docs/csharp/11.md @@ -10,7 +10,7 @@ * * * -## C# `if`(`if-then`)语句 +## C# `if`语句 如果给定条件为真,则 C# `if-then`语句将执行代码块。 C# 中`if-then`语句的语法为: @@ -92,7 +92,7 @@ This statement is always executed. * * * -## C# `if...else`(`if-then-else`)语句 +## C# `if...else`语句 C# 中的`if`语句可能具有可选的`else`语句。 如果将表达式计算为`false`,则将执行`else`语句中的代码块。 @@ -194,7 +194,7 @@ This statement is always executed. * * * -## C# `if...else if`(`if-then-else if`)语句 +## C# `if...else if`语句 当我们只有一个条件要测试时,`if-then`和`if-then-else`语句可以正常工作。 但是,如果我们有多个条件来测试和执行众多代码块之一,该怎么办? diff --git a/docs/csharp/12.md b/docs/csharp/12.md index af5acfa..c8b7663 100644 --- a/docs/csharp/12.md +++ b/docs/csharp/12.md @@ -91,7 +91,7 @@ C# For Loop: Iteration 5 * 再次求值条件(`i<=5`),最后将`i`的值加 1。该条件将在前 5 次求值为`true`。 * 当`i`的值为 6 并且条件为`false`时,循环将终止。 -### 示例 2:`for`循环计算前 n 个自然数之和 +### 示例 2:计算前 n 个自然数之和的`for`循环 ```cs using System; @@ -183,7 +183,7 @@ i = 2 and j = 2 * * * -## 对于没有初始化和迭代器语句的循环 +## 没有初始化和迭代器语句的`for`循环 初始化,条件和迭代器语句在`for`循环中是可选的。 这意味着我们也可以在没有这些语句的情况下运行`for`循环。 diff --git a/docs/csharp/13.md b/docs/csharp/13.md index eb3f18d..9f3a7f6 100644 --- a/docs/csharp/13.md +++ b/docs/csharp/13.md @@ -76,7 +76,7 @@ C# For Loop: Iteration 5 * 现在,再次求值测试表达式(`i <= 5`)。 同样,这次表达式也返回`true`(`2 <= 5`),因此该行将打印在屏幕上,并且`i`的值现在增加到 3。 * 这样下去,`while`循环将执行到`i`变为 6。此时,`test-expression`的计算结果为`false`,因此循环终止。 -### 示例 2:`while`循环,用于计算前 5 个自然数的和 +### 示例 2:计算前 5 个自然数的和的`while`循环 ```cs using System; diff --git a/docs/csharp/14.md b/docs/csharp/14.md index 75aa904..9297511 100644 --- a/docs/csharp/14.md +++ b/docs/csharp/14.md @@ -146,7 +146,7 @@ Number of female = 4 * * * -## 示例 4:带有列表(集合)的`foreach`循环 +## 示例 4:`foreach`循环和列表(集合) 该程序计算*列表*中元素的总和。 diff --git a/docs/csharp/15.md b/docs/csharp/15.md index cdca112..607db65 100644 --- a/docs/csharp/15.md +++ b/docs/csharp/15.md @@ -140,7 +140,7 @@ namespace Conditional * * * -## 示例 3:使用 C# 开关的简单计算器程序 +## 示例 3:使用 C# `switch`的简单计算器程序 ```cs using System; diff --git a/docs/csharp/20.md b/docs/csharp/20.md index b938208..a9d4370 100644 --- a/docs/csharp/20.md +++ b/docs/csharp/20.md @@ -9,10 +9,10 @@ 命名空间可以具有以下类型作为其成员: 1. 命名空间(嵌套命名空间) -2. 班级 -3. 介面 -4. 结构体 -5. 代表们 +2. 类 +3. 接口 +4. 结构 +5. 委托 我们将在以后的教程中讨论这些主题。 现在,我们将坚持使用类和命名空间。 diff --git a/docs/csharp/21.md b/docs/csharp/21.md index 60cee0d..c1f49d9 100644 --- a/docs/csharp/21.md +++ b/docs/csharp/21.md @@ -86,7 +86,7 @@ namespace HeightWeightInfo * * * -### 部分类要记住的事情 +### 要记住的事情 `partial`关键字指定可以在命名空间中定义类的其他部分。 如果我们要使一个类成为局部类,则必须使用`partial`关键字。 类的所有部分都应该在相同的命名空间中,并在编译时可用以形成最终类型。 所有部分都必须具有相同的访问修饰符,即私有,公共等。 diff --git a/docs/csharp/3.md b/docs/csharp/3.md index 1e2fca4..d91cd45 100644 --- a/docs/csharp/3.md +++ b/docs/csharp/3.md @@ -109,7 +109,7 @@ Console.WriteLine("Hello World!"); * * * -## 本文要记住的事情 +## 本文中要记住的事情 * 每个 C# 程序都必须具有一个类定义。 * 程序的执行从`Main()`方法开始。 diff --git a/docs/csharp/4.md b/docs/csharp/4.md index 1791fa0..6f695b8 100644 --- a/docs/csharp/4.md +++ b/docs/csharp/4.md @@ -57,7 +57,7 @@ int @void; * * * -### 内容比对关键字 +### 上下文关键字 除了常规关键字,C# 还具有 25 个上下文关键字。 上下文关键字在有限的程序上下文中具有特定含义,并且可以用作该上下文之外的标识符。 它们不是 C# 中的保留字。 diff --git a/docs/csharp/5.md b/docs/csharp/5.md index c31e1cf..86faac3 100644 --- a/docs/csharp/5.md +++ b/docs/csharp/5.md @@ -124,7 +124,7 @@ C# 中的变量大致分为两种类型**:值类型**和**引用类型**。 参考类型将在以后的教程中介绍。 但是,如果您想了解更多有关变量类型的信息,请访问 [C# 类型和变量](https://docs.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/types-and-variables)(官方 C# 文档)。 -### 布尔值(布尔) +### `bool`(布尔) * 布尔数据类型具有两个可能的值:`true`或`false` * **默认值**:`false` diff --git a/docs/csharp/6.md b/docs/csharp/6.md index 06694ff..6728e1d 100644 --- a/docs/csharp/6.md +++ b/docs/csharp/6.md @@ -12,9 +12,9 @@ * * * -## 1.基本分配运算符 +## 1.基本赋值运算符 -基本赋值运算符(=)用于为变量赋值。 例如, +基本赋值运算符(`=`)用于为变量赋值。 例如, ```cs double x; diff --git a/docs/csharp/7.md b/docs/csharp/7.md index 8613911..95b3edb 100644 --- a/docs/csharp/7.md +++ b/docs/csharp/7.md @@ -79,11 +79,11 @@ Prints on Same line * * * -### 使用`WriteLine()`和`Write()`打印变量和文字 +### 使用`WriteLine()`和`Write()`打印变量和字面值 -`WriteLine()`和`Write()`方法可用于打印变量和文字。 这是一个例子。 +`WriteLine()`和`Write()`方法可用于打印变量和字面值。 这是一个例子。 -#### 示例 3:打印变量和文字 +#### 示例 3:打印变量和字面值 ```cs using System; @@ -114,11 +114,11 @@ When we run the program, the output will be * * * -### 使用+运算符组合(连接)两个字符串并打印它们 +### 使用`+`运算符组合(连接)两个字符串并打印它们 在打印时,可以使用`+`操作符对字符串进行合并/连接。 -#### 示例 4:使用`+`运算符打印连接的字符串 +#### 示例 4:打印使用`+`运算符连接的字符串 ```cs using System; @@ -146,7 +146,7 @@ Value = 55 * * * -### 使用格式化字符串打印并置字符串[更好的选择] +### 使用字符串格式化打印连接的字符串【更好的选择】 打印连接字符串的更好的选择是使用格式化字符串。 格式化字符串允许程序员使用占位符作为变量。 例如, @@ -166,7 +166,7 @@ Console.WriteLine("Value = {0}", val); 格式化的字符串中可以使用多个变量。 我们将在下面的示例中看到这一点。 -#### 示例 5:使用字符串格式打印连接的字符串 +#### 示例 5:使用字符串格式化打印连接的字符串 ```cs using System; diff --git a/docs/csharp/8.md b/docs/csharp/8.md index c2362fb..6232199 100644 --- a/docs/csharp/8.md +++ b/docs/csharp/8.md @@ -52,12 +52,12 @@ Int marks = 90; C# 中有不同类型的语句。 在本教程中,我们将主要关注其中两个: -1. 声明书 -2. 表达声明 +1. 声明语句 +2. 表达式语句 * * * -### 声明声明 +### 声明语句 声明语句用于声明和初始化变量。 @@ -72,7 +72,7 @@ int maxValue = 55; * * * -### 表达声明 +### 表达式语句 表达式后跟分号称为表达式语句。 diff --git a/docs/csharp/9.md b/docs/csharp/9.md index f062357..2204eb1 100644 --- a/docs/csharp/9.md +++ b/docs/csharp/9.md @@ -168,8 +168,8 @@ namespace HelloWorld Console.WriteLine("Hello World"); ``` -上面的示例中不必使用注释。 很明显,该行将打印 HelloWorld。 在这种情况下,应避免发表评论。 +上面的示例中不必使用注释。 很明显,该行将打印 HelloWorld。 在这种情况下,应避免编写注释。 * 而是应在程序中使用注释来解释复杂的算法和技术。 -* 评论应简短,切题而不是冗长的描述。 +* 注释应简短,切题而不是冗长的描述。 * 根据经验,最好使用注释解释**为什么**而不是**做什么**。 \ No newline at end of file -- GitLab