Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
programiz-zh
提交
ed8731ae
P
programiz-zh
项目概览
OpenDocCN
/
programiz-zh
9 个月 前同步成功
通知
0
Star
48
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
programiz-zh
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ed8731ae
编写于
7月 10, 2020
作者:
W
wizardforcel
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
2020-07-10 21:45:17
上级
f74e8860
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
43 addition
and
43 deletion
+43
-43
docs/c/4.md
docs/c/4.md
+1
-1
docs/c/45.md
docs/c/45.md
+1
-1
docs/cpp/11.md
docs/cpp/11.md
+1
-1
docs/csharp/12.md
docs/csharp/12.md
+1
-1
docs/csharp/13.md
docs/csharp/13.md
+1
-1
docs/csharp/18.md
docs/csharp/18.md
+2
-2
docs/csharp/6.md
docs/csharp/6.md
+6
-6
docs/java/159.md
docs/java/159.md
+1
-1
docs/java/171.md
docs/java/171.md
+1
-1
docs/java/175.md
docs/java/175.md
+1
-1
docs/java/176.md
docs/java/176.md
+1
-1
docs/java/186.md
docs/java/186.md
+1
-1
docs/kotlin/5.md
docs/kotlin/5.md
+1
-1
docs/kotlin/65.md
docs/kotlin/65.md
+1
-1
docs/kotlin/77.md
docs/kotlin/77.md
+1
-1
docs/kotlin/81.md
docs/kotlin/81.md
+1
-1
docs/kotlin/82.md
docs/kotlin/82.md
+1
-1
docs/kotlin/92.md
docs/kotlin/92.md
+1
-1
docs/swift/12.md
docs/swift/12.md
+4
-4
docs/swift/13.md
docs/swift/13.md
+2
-2
docs/swift/15.md
docs/swift/15.md
+3
-3
docs/swift/19.md
docs/swift/19.md
+4
-4
docs/swift/20.md
docs/swift/20.md
+2
-2
docs/swift/33.md
docs/swift/33.md
+2
-2
docs/swift/4.md
docs/swift/4.md
+1
-1
docs/swift/7.md
docs/swift/7.md
+1
-1
未找到文件。
docs/c/4.md
浏览文件 @
ed8731ae
...
...
@@ -102,7 +102,7 @@ Hexadecimal: 0x7f, 0x2a, 0x521 etc
为了使用这些字符,使用了转义序列。
Escape Sequences
转义序列
| 转义序列 | 字符 |
| --- | --- |
...
...
docs/c/45.md
浏览文件 @
ed8731ae
...
...
@@ -87,7 +87,7 @@ fopen("E:\\cprogram\\oldprogram.bin","rb");
*
现在,我们假设第二个二进制文件
`oldprogram.bin`
存在于位置
`E:\cprogram`
中。 第二个功能打开现有文件,以二进制模式
`'rb'`
读取。
读取模式仅允许您读取文件,而不能写入文件。
Opening Modes in Standard I/O
标准 I/O 中的打开模式
| 模式 | 模式的含义 | 文件不存在期间 |
| --- | --- | --- |
...
...
docs/cpp/11.md
浏览文件 @
ed8731ae
...
...
@@ -112,7 +112,7 @@ Hello World!
Hello
World
!
```
Here is how this program works
该程序的工作原理如下
| 迭代 | 变量 |
`i <= 5`
| 行为 |
| --- | --- | --- | --- |
...
...
docs/csharp/12.md
浏览文件 @
ed8731ae
...
...
@@ -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`
的值 |
| --- | --- | --- | --- |
...
...
docs/csharp/13.md
浏览文件 @
ed8731ae
...
...
@@ -116,7 +116,7 @@ Sum = 15
最初,
`i = 1`
,
`sum = 0`
While loop execution steps
`while`
循环执行步骤
| 迭代 |
`i`
的值 |
`i <= 5`
|
`sum`
的值 |
| --- | --- | --- | --- |
...
...
docs/csharp/18.md
浏览文件 @
ed8731ae
...
...
@@ -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 的补码 |
| --- | --- | --- |
...
...
docs/csharp/6.md
浏览文件 @
ed8731ae
...
...
@@ -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>
||
</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#
复合赋值运算符
| 运算符 | 运算符名称 | 示例 | 相当于 |
| --- | --- | --- | --- |
...
...
docs/java/159.md
浏览文件 @
ed8731ae
...
...
@@ -49,7 +49,7 @@ public class Palindrome {
以下是执行的步骤:
Palindrome execution steps
回文执行步骤
|
`num`
|
`num != 0`
|
`remainder`
|
`reversedInteger`
|
| --- | --- | --- | --- |
...
...
docs/java/171.md
浏览文件 @
ed8731ae
...
...
@@ -38,7 +38,7 @@ GCD of 366 and 60 is 6.
在上面的程序中,递归函数被调用直到
`n2`
为 0。最后,
`n1`
的值是给定两个数字的 GCD 或 HCF。
Execution Steps
执行步骤
| 序号 | 递归调用 |
`n1`
|
`n2`
|
`n1%n2`
|
| --- | --- | --- | --- | --- |
...
...
docs/java/175.md
浏览文件 @
ed8731ae
...
...
@@ -39,7 +39,7 @@ The reversed sentence is: krow oG
最后,我们以空的
`sentence`
和
`reverse()`
返回相反的句子结束。
Execution steps
执行步骤
| 迭代 |
`reverse()`
|
`substring()`
|
`reversedString`
|
| --- | --- | --- | --- |
...
...
docs/java/176.md
浏览文件 @
ed8731ae
...
...
@@ -39,7 +39,7 @@ public class Power {
3
*
3
*
3
*
3
=
81
```
Execution steps
执行步骤
| 迭代 |
`power()`
|
`powerRaised`
| 结果 |
| --- | --- | --- | --- |
...
...
docs/java/186.md
浏览文件 @
ed8731ae
...
...
@@ -48,7 +48,7 @@ Ruby
如果
`compareTo()`
的返回值大于 0,则必须在位置上进行交换,即
`word[i]`
在
`word[j]`
之后。 因此,在每次迭代中,
`word[i]`
包含最早的单词。
Execution Steps
执行步骤
| 迭代 | 初始词 |
`i`
|
`j`
|
`word[]`
|
| --- | --- | --- | --- | --- |
...
...
docs/kotlin/5.md
浏览文件 @
ed8731ae
...
...
@@ -14,7 +14,7 @@
以下是 Kotlin 中的算术运算符列表:
Kotlin
Arithmetic Operators
Kotlin
算术运算符
| 运算符 | 含义 |
| --- | --- |
...
...
docs/kotlin/65.md
浏览文件 @
ed8731ae
...
...
@@ -55,7 +55,7 @@ fun main(args: Array<String>) {
以下是执行的步骤:
Palindrome execution steps
回文执行步骤
|
`num`
|
`num != 0`
|
`remainder`
|
`reversedInteger`
|
| --- | --- | --- | --- |
...
...
docs/kotlin/77.md
浏览文件 @
ed8731ae
...
...
@@ -35,7 +35,7 @@ GCD of 366 and 60 is 6.
在上面的程序中,递归函数被调用直到
`n2`
为 0。最后,
`n1`
的值是给定两个数字的 GCD 或 HCF。
Execution Steps
执行步骤
| 序号 | 递归调用 |
`n1`
|
`n2`
|
`n1 % n2`
|
| --- | --- | --- | --- | --- |
...
...
docs/kotlin/81.md
浏览文件 @
ed8731ae
...
...
@@ -35,7 +35,7 @@ The reversed sentence is: krow oG
最后,我们以空的
`sentence`
和
`reverse()`
返回相反的句子结束。
Execution steps
执行步骤
| 迭代 |
`reverse()`
|
`substring()`
|
`reversedString`
|
| --- | --- | --- | --- |
...
...
docs/kotlin/82.md
浏览文件 @
ed8731ae
...
...
@@ -37,7 +37,7 @@ fun power(base: Int, powerRaised: Int): Int {
3 * 3 * 3 * 3 = 81
```
Execution steps
执行步骤
| 迭代 |
`power()`
|
`powerRaised`
|
`result`
|
| --- | --- | --- | --- |
...
...
docs/kotlin/92.md
浏览文件 @
ed8731ae
...
...
@@ -46,7 +46,7 @@ Ruby
如果
`compareTo()`
的返回值大于 0,则必须在位置上进行交换,即
`word[i]`
在
`word[j]`
之后。 因此,在每次迭代中,
`words[i]`
包含最早的单词。
Execution Steps
执行步骤
| 迭代 | 初始单词 |
`i`
|
`j`
|
`words[]`
|
| --- | --- | --- | --- | --- |
...
...
docs/swift/12.md
浏览文件 @
ed8731ae
...
...
@@ -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
逻辑运算符
| 运算符 | 含义 | 示例 |
| --- | --- | --- |
...
...
docs/swift/13.md
浏览文件 @
ed8731ae
...
...
@@ -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**
|
...
...
docs/swift/15.md
浏览文件 @
ed8731ae
...
...
@@ -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
|
y
</code>
|
| --- | --- | --- |
...
...
@@ -211,7 +211,7 @@ Binary: 11111111
如果
`x`
和
`y`
是变量/常数,且保持二进制值,即 0 或 1。则
`x`
和
`y`
的按位异或运算如下表所示:
XOR
异或
|
`x`
|
`y`
|
`x ^ y`
|
| --- | --- | --- |
...
...
docs/swift/19.md
浏览文件 @
ed8731ae
...
...
@@ -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 != "!"`
| 输出 |
| --- | --- | --- | --- |
...
...
docs/swift/20.md
浏览文件 @
ed8731ae
...
...
@@ -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`
) | 输出 |
| --- | --- | --- |
...
...
docs/swift/33.md
浏览文件 @
ed8731ae
...
...
@@ -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`
语句 | 值 |
| --- | --- | --- | --- |
...
...
docs/swift/4.md
浏览文件 @
ed8731ae
...
...
@@ -32,7 +32,7 @@ print(siteName)
### 如何在 Swift 中为变量赋值?
您可以使用
[
赋值运算符
](
/swift-programming/operators#assignment
"Swift
Assignment Operators
"
)
(=)在变量中赋值。
您可以使用
[
赋值运算符
](
/swift-programming/operators#assignment
"Swift
赋值运算符
"
)
(=)在变量中赋值。
#### 示例 1:声明并将值赋给变量
...
...
docs/swift/7.md
浏览文件 @
ed8731ae
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录