提交 ed8731ae 编写于 作者: W wizardforcel

2020-07-10 21:45:17

上级 f74e8860
......@@ -102,7 +102,7 @@ Hexadecimal: 0x7f, 0x2a, 0x521 etc
为了使用这些字符,使用了转义序列。
Escape Sequences
转义序列
| 转义序列 | 字符 |
| --- | --- |
......
......@@ -87,7 +87,7 @@ fopen("E:\\cprogram\\oldprogram.bin","rb");
* 现在,我们假设第二个二进制文件`oldprogram.bin`存在于位置`E:\cprogram`中。 第二个功能打开现有文件,以二进制模式`'rb'`读取。
读取模式仅允许您读取文件,而不能写入文件。
Opening Modes in Standard I/O
标准 I/O 中的打开模式
| 模式 | 模式的含义 | 文件不存在期间 |
| --- | --- | --- |
......
......@@ -112,7 +112,7 @@ Hello World!
Hello World!
```
Here is how this program works
该程序的工作原理如下
| 迭代 | 变量 | `i <= 5` | 行为 |
| --- | --- | --- | --- |
......
......@@ -130,7 +130,7 @@ Sum of first 5 natural numbers = 15
最初,`i = 1``sum = 0``n = 3`
For loop execution steps
`for`循环执行步骤
| 迭代 | `i`的值 | `i <= 5` | `sum`的值 |
| --- | --- | --- | --- |
......
......@@ -116,7 +116,7 @@ Sum = 15
最初,`i = 1``sum = 0`
While loop execution steps
`while`循环执行步骤
| 迭代 | `i`的值 | `i <= 5` | `sum`的值 |
| --- | --- | --- | --- |
......
......@@ -10,7 +10,7 @@
下面列出了 C# 中可用的按位和移位运算符。
List of C# Bitwise Operators
C# 按位运算符列表
| 运算符 | 运算符名称 |
| --- | --- |
......@@ -219,7 +219,7 @@ namespace Operator
对于任何整数`n``n`的 2 的补码将为`-(n+1)`
2's complement
2 的补码
| 小数 | 二进制 | 2 的补码 |
| --- | --- | --- |
......
......@@ -73,7 +73,7 @@ int z = x + y;// z = 15
```
C# Arithmetic Operators
C# 算术运算符
| 运算符 | 运算符名称 | 示例 |
| --- | --- | --- |
......@@ -146,7 +146,7 @@ result = firstNumber - 3.2; // result will hold 11.2
关系运算符用于决策和循环。
C# Relational Operators
C# 关系运算符
| 运算符 | 运算符名称 | 示例 |
| --- | --- | --- |
......@@ -212,7 +212,7 @@ namespace Operator
这是如何为逻辑`AND``OR`运算符求值结果的方法。
C# Logical operators
C# 逻辑运算符
| 操作数 1 | 操作数 2 | 或(<code>&#124;&#124;</code>) | 且(`&&`) |
| --- | --- | --- | --- |
......@@ -265,7 +265,7 @@ False
与其他运算符不同,一元运算符对单个操作数进行运算。
C# unary operators
C# 一元运算符
| 运算符 | 运算符名称 | 描述 |
| --- | --- | --- |
......@@ -419,7 +419,7 @@ namespace Operator
按位和移位运算符用于执行位操作。
C# Bitwise and Bit Shift operators
C# 按位和移位操作
| 运算符 | 运算符名称 |
| --- | --- |
......@@ -484,7 +484,7 @@ namespace Operator
## 8.复合赋值运算符
C# Compound Assignment Operators
C# 复合赋值运算符
| 运算符 | 运算符名称 | 示例 | 相当于 |
| --- | --- | --- | --- |
......
......@@ -49,7 +49,7 @@ public class Palindrome {
以下是执行的步骤:
Palindrome execution steps
回文执行步骤
| `num` | `num != 0` | `remainder` | `reversedInteger` |
| --- | --- | --- | --- |
......
......@@ -38,7 +38,7 @@ GCD of 366 and 60 is 6.
在上面的程序中,递归函数被调用直到`n2`为 0。最后,`n1`的值是给定两个数字的 GCD 或 HCF。
Execution Steps
执行步骤
| 序号 | 递归调用 | `n1` | `n2` | `n1%n2` |
| --- | --- | --- | --- | --- |
......
......@@ -39,7 +39,7 @@ The reversed sentence is: krow oG
最后,我们以空的`sentence``reverse()`返回相反的句子结束。
Execution steps
执行步骤
| 迭代 | `reverse()` | `substring()` | `reversedString` |
| --- | --- | --- | --- |
......
......@@ -39,7 +39,7 @@ public class Power {
3 * 3 * 3 * 3 = 81
```
Execution steps
执行步骤
| 迭代 | `power()` | `powerRaised` | 结果 |
| --- | --- | --- | --- |
......
......@@ -48,7 +48,7 @@ Ruby
如果`compareTo()`的返回值大于 0,则必须在位置上进行交换,即`word[i]``word[j]`之后。 因此,在每次迭代中,`word[i]`包含最早的单词。
Execution Steps
执行步骤
| 迭代 | 初始词 | `i` | `j` | `word[]` |
| --- | --- | --- | --- | --- |
......
......@@ -14,7 +14,7 @@
以下是 Kotlin 中的算术运算符列表:
Kotlin Arithmetic Operators
Kotlin 算术运算符
| 运算符 | 含义 |
| --- | --- |
......
......@@ -55,7 +55,7 @@ fun main(args: Array<String>) {
以下是执行的步骤:
Palindrome execution steps
回文执行步骤
| `num` | `num != 0` | `remainder` | `reversedInteger` |
| --- | --- | --- | --- |
......
......@@ -35,7 +35,7 @@ GCD of 366 and 60 is 6.
在上面的程序中,递归函数被调用直到`n2`为 0。最后,`n1`的值是给定两个数字的 GCD 或 HCF。
Execution Steps
执行步骤
| 序号 | 递归调用 | `n1` | `n2` | `n1 % n2` |
| --- | --- | --- | --- | --- |
......
......@@ -35,7 +35,7 @@ The reversed sentence is: krow oG
最后,我们以空的`sentence``reverse()`返回相反的句子结束。
Execution steps
执行步骤
| 迭代 | `reverse()` | `substring()` | `reversedString` |
| --- | --- | --- | --- |
......
......@@ -37,7 +37,7 @@ fun power(base: Int, powerRaised: Int): Int {
3 * 3 * 3 * 3 = 81
```
Execution steps
执行步骤
| 迭代 | `power()` | `powerRaised` | `result` |
| --- | --- | --- | --- |
......
......@@ -46,7 +46,7 @@ Ruby
如果`compareTo()`的返回值大于 0,则必须在位置上进行交换,即`word[i]``word[j]`之后。 因此,在每次迭代中,`words[i]`包含最早的单词。
Execution Steps
执行步骤
| 迭代 | 初始单词 | `i` | `j` | `words[]` |
| --- | --- | --- | --- | --- |
......
......@@ -86,7 +86,7 @@ Value Smaller
快速使用赋值运算符将值赋给属性(变量/常量)。
Swift Assignment Operators
Swift 赋值运算符
| 运算符 | 含义 |
| --- | --- |
......@@ -146,7 +146,7 @@ print(x)
这些运算符用于执行数学运算,包括乘法,除法,加法和减法等。该运算符属于采用两个操作数的二进制运算符。
Swift Arithmetic Operators
Swift 算术运算符
| 运算符 | 含义 |
| --- | --- |
......@@ -202,7 +202,7 @@ print(y)
这些运算符使您可以比较两个值。 每个比较运算符均返回`Bool`值以指示该语句是否为真。 Swift 支持以下类型的比较运算符:
Swift Comparison Operators
Swift 比较运算符
| 运算符 | 含义 | 示例 |
| --- | --- | --- |
......@@ -252,7 +252,7 @@ false
这些运算符与布尔(逻辑)值一起使用,并返回布尔值。 它主要用于通过`if else``while`或其他一些控制语句来控制程序流。
Swift Logical Operators
Swift 逻辑运算符
| 运算符 | 含义 | 示例 |
| --- | --- | --- |
......
......@@ -49,7 +49,7 @@ print(x)
在上面的示例中,如果从左到右读取表达式,则可能期望输出为 45。但是,乘法运算符的优先级高于加法运算符,因此表达式`4 + 5 * 5`的求值为`4 + (5 * 5)`。 因此,`print(x)`在屏幕上输出 29。
Execution Steps
执行步骤
| 步骤 | 运算符 | 表达式 | 表达式返回的值 |
| --- | --- | --- | --- |
......@@ -79,7 +79,7 @@ print(y)
因此,表达式`y += 10 - 2 * 3`被求值为`y = y + (10 - (2 * 3))`
Execution Steps
执行步骤
| 步骤 | 运算符 | 表达式 | 表达式返回的值 |
| 1 | `=` | `var y = 15` | **15** |
......
......@@ -129,7 +129,7 @@ print(0b11111110)
如果`x``y`是变量/常数,且保持二进制值(即 0 或 1),则`x``y`的按位与运算如下表所示:
AND
| `x` | `y` | `x & y` |
| --- | --- | --- |
......@@ -171,7 +171,7 @@ Binary: 10000011
如果`x``y`是变量/常数,且保持二进制值,即 0 或 1。则`x``y`的按位或运算如下表所示:
OR
| `x` | `y` | <code>x &#124; y</code> |
| --- | --- | --- |
......@@ -211,7 +211,7 @@ Binary: 11111111
如果`x``y`是变量/常数,且保持二进制值,即 0 或 1。则`x``y`的按位异或运算如下表所示:
XOR
异或
| `x` | `y` | `x ^ y` |
| --- | --- | --- |
......
......@@ -85,7 +85,7 @@ Hello world!. Value is 3
`i`的值设置为范围(1)中的第一个数字,并在每次迭代时更新为范围的下一个数字。 此过程一直持续到到达范围(3)的末尾。
For-in loop execution steps
`For-in`循环执行步骤
| 迭代 | 从范围(`i`)返回的值 | 输出 |
| --- | --- | --- |
......@@ -126,7 +126,7 @@ Hello world!
`_`忽略范围(1)中的值,并执行打印语句。 再次调用`print`语句进行下一次迭代,并且过程结束,因为 2 是该范围内的最后一个值。
For-in loop execution steps without range values
没有范围值的`for-in`循环执行步骤
| 迭代 | 范围返回的值 | 输出 |
| --- | --- | --- |
......@@ -164,7 +164,7 @@ for i in stride(from: 1, to: 10, by: interval) {
执行该语句后,`i`的值将更新为另一个值(3),并再次调用`print`语句。 该过程一直持续到访问序列中的所有元素为止。
For-in loop execution steps using stride
使用步长的`for-in`循环执行步骤
| 值 | 条件(`i < end`) | `i`(输出) |
| --- | --- | --- |
......@@ -304,7 +304,7 @@ t
此过程一直持续到访问字符串的最后一个字符为止。
Filter using for-in loop execution steps
带有过滤的`for-in`循环执行步骤
| 迭代 | 值 | `value != "!"` | 输出 |
| --- | --- | --- | --- |
......
......@@ -74,7 +74,7 @@ outside of while loop
`while`循环的每次迭代中,它都会检查条件`currentLevel <= finalLevel`。 如果条件返回`true`,则执行`while`循环内的语句,否则循环终止。
Execution steps
执行步骤
| 迭代 | 条件(`currentLevel <= finalLevel`) | 输出 |
| --- | --- | --- |
......@@ -150,7 +150,7 @@ outside of repeat while loop
如果条件返回`true`,则执行`while`循环内的语句,否则循环终止。
Execution steps
执行步骤
| 迭代 | 条件(`currentLevel <= finalLevel`) | 输出 |
| --- | --- | --- |
......
......@@ -58,7 +58,7 @@ Countdown:
### 让我们逐步来看一下
Execution steps
执行步骤
| 步骤 | 函数调用 | 打印 | `num > 0`? |
| --- | --- | --- | --- |
......@@ -97,7 +97,7 @@ The factorial of 4 is 24
### Let's see this in steps
Execution steps
执行步骤
| 步骤 | 传递的参数 | `return`语句 | 值 |
| --- | --- | --- | --- |
......
......@@ -32,7 +32,7 @@ print(siteName)
### 如何在 Swift 中为变量赋值?
您可以使用[赋值运算符](/swift-programming/operators#assignment "Swift Assignment Operators")(=)在变量中赋值。
您可以使用[赋值运算符](/swift-programming/operators#assignment "Swift 赋值运算符")(=)在变量中赋值。
#### 示例 1:声明并将值赋给变量
......
......@@ -143,7 +143,7 @@ true
#### 字符串连接
可以使用[加法运算符](/swift-programming/operators#arithmetic "Swift arithmetic operators") `(+)`或使用[复合赋值运算符](/swift-programming/operators#assignment "Swift assignment operators") `(+=)`将两个不同的字符串值相加。 您也可以使用`append`方法在字符串中附加一个字符/字符串。
可以使用[加法运算符](/swift-programming/operators#arithmetic "Swift arithmetic operators") `(+)`或使用[复合赋值运算符](/swift-programming/operators#assignment "Swift 赋值运算符") `(+=)`将两个不同的字符串值相加。 您也可以使用`append`方法在字符串中附加一个字符/字符串。
**示例 6:Swift** 中的字符串连接
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册