fix: replace languages preceded by space
This commit is contained in:
committed by
Kristofer Koishigawa
parent
2b553d31b6
commit
8ce1b374e3
@@ -60,7 +60,7 @@ Lets write a program which will print numbers from 0 to 1000 including 1000 on t
|
|||||||
` for(int i=0;i<=1000;i++) `
|
` for(int i=0;i<=1000;i++) `
|
||||||
* If there is only one statement inside the loop then the curly bracket is optional but its better to write loop code
|
* If there is only one statement inside the loop then the curly bracket is optional but its better to write loop code
|
||||||
within brackets so that you don't get confused.
|
within brackets so that you don't get confused.
|
||||||
``` c++
|
```cpp
|
||||||
for(int i=0;i<=1000;i++)
|
for(int i=0;i<=1000;i++)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -70,11 +70,10 @@ Lets write a program which will print numbers from 0 to 1000 including 1000 on t
|
|||||||
So, in this way the for loop works
|
So, in this way the for loop works
|
||||||
|
|
||||||
If you want to print even numbers from 1 to 1000 then your program will look like this
|
If you want to print even numbers from 1 to 1000 then your program will look like this
|
||||||
``
|
```cpp
|
||||||
|
لـ (int i = 0؛ i = 1000 = i = i + 2) { cout << i << endl؛ }
|
||||||
|
|
||||||
ج ++ لـ (int i = 0؛ i = 1000 = i = i + 2) { cout << i << endl؛ }
|
```
|
||||||
|
|
||||||
\`\` \`
|
|
||||||
|
|
||||||
* الفرق في البرنامج الأول والثاني هو جزء الزيادة. بقية الكود هو نفسه. هذا البرنامج سوف يطبع 0 و ثم إضافة 2 إليه وطباعة 2 على وحدة التحكم وهكذا تصبح قيمة up تساوي 1000.
|
* الفرق في البرنامج الأول والثاني هو جزء الزيادة. بقية الكود هو نفسه. هذا البرنامج سوف يطبع 0 و ثم إضافة 2 إليه وطباعة 2 على وحدة التحكم وهكذا تصبح قيمة up تساوي 1000.
|
||||||
|
|
||||||
|
@@ -57,7 +57,7 @@ When you execute this code in a c++ program numbers from 1 to 1000 will be print
|
|||||||
` for(int i=0;i<=1000;i++) `
|
` for(int i=0;i<=1000;i++) `
|
||||||
* If there is only one statement inside the loop then the curly bracket is optional but its better to write loop code
|
* If there is only one statement inside the loop then the curly bracket is optional but its better to write loop code
|
||||||
within brackets so that you don't get confused.
|
within brackets so that you don't get confused.
|
||||||
``` c++
|
```cpp
|
||||||
for(int i=0;i<=1000;i++)
|
for(int i=0;i<=1000;i++)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -28,7 +28,7 @@ Note that inlining is only a request to the compiler, not a command. The compile
|
|||||||
* When performance is important.
|
* When performance is important.
|
||||||
* Instead of a macro.
|
* Instead of a macro.
|
||||||
|
|
||||||
``` c++
|
```cpp
|
||||||
#include<iostream>
|
#include<iostream>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
@@ -16,7 +16,7 @@ There is this concept in mathematics: "each generating function has a sequence a
|
|||||||
In this section we'll show you how to include the standard math library in different languages including a short example of how you can use it.
|
In this section we'll show you how to include the standard math library in different languages including a short example of how you can use it.
|
||||||
|
|
||||||
#### C#
|
#### C#
|
||||||
``` cs
|
```csharp
|
||||||
using System.Math;
|
using System.Math;
|
||||||
|
|
||||||
public class Calculator {
|
public class Calculator {
|
||||||
|
@@ -57,7 +57,7 @@ When you execute this code in a c++ program numbers from 1 to 1000 will be print
|
|||||||
` for(int i=0;i<=1000;i++) `
|
` for(int i=0;i<=1000;i++) `
|
||||||
* If there is only one statement inside the loop then the curly bracket is optional but its better to write loop code
|
* If there is only one statement inside the loop then the curly bracket is optional but its better to write loop code
|
||||||
within brackets so that you don't get confused.
|
within brackets so that you don't get confused.
|
||||||
``` c++
|
```cpp
|
||||||
for(int i=0;i<=1000;i++)
|
for(int i=0;i<=1000;i++)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -57,7 +57,7 @@ When you execute this code in a c++ program numbers from 1 to 1000 will be print
|
|||||||
` for(int i=0;i<=1000;i++) `
|
` for(int i=0;i<=1000;i++) `
|
||||||
* If there is only one statement inside the loop then the curly bracket is optional but its better to write loop code
|
* If there is only one statement inside the loop then the curly bracket is optional but its better to write loop code
|
||||||
within brackets so that you don't get confused.
|
within brackets so that you don't get confused.
|
||||||
``` c++
|
```cpp
|
||||||
for(int i=0;i<=1000;i++)
|
for(int i=0;i<=1000;i++)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -57,7 +57,7 @@ When you execute this code in a c++ program numbers from 1 to 1000 will be print
|
|||||||
` for(int i=0;i<=1000;i++) `
|
` for(int i=0;i<=1000;i++) `
|
||||||
* If there is only one statement inside the loop then the curly bracket is optional but its better to write loop code
|
* If there is only one statement inside the loop then the curly bracket is optional but its better to write loop code
|
||||||
within brackets so that you don't get confused.
|
within brackets so that you don't get confused.
|
||||||
``` c++
|
```cpp
|
||||||
for(int i=0;i<=1000;i++)
|
for(int i=0;i<=1000;i++)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -67,18 +67,18 @@ When you execute this code in a c++ program numbers from 1 to 1000 will be print
|
|||||||
So, in this way the for loop works
|
So, in this way the for loop works
|
||||||
|
|
||||||
If you want to print even numbers from 1 to 1000 then your program will look like this
|
If you want to print even numbers from 1 to 1000 then your program will look like this
|
||||||
|
```cpp
|
||||||
|
|
||||||
|
para (int i = 0; i <= 1000; i = i + 2) { cout << i << endl; }
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
c ++ para (int i = 0; i <= 1000; i = i + 2) { cout << i << endl; }
|
|
||||||
|
|
||||||
\`\` \`
|
|
||||||
|
|
||||||
* La diferencia entre el primer programa y el segundo es la parte de incremento. El resto del código es el mismo. Este programa imprimirá 0 y luego agregue 2 e imprima 2 en la consola y así sucesivamente hasta que el valor de i sea igual a 1000.
|
* La diferencia entre el primer programa y el segundo es la parte de incremento. El resto del código es el mismo. Este programa imprimirá 0 y luego agregue 2 e imprima 2 en la consola y así sucesivamente hasta que el valor de i sea igual a 1000.
|
||||||
|
|
||||||
Nuestro programa final para imprimir números pares de 0 a 1000 se verá así.
|
Nuestro programa final para imprimir números pares de 0 a 1000 se verá así.
|
||||||
|
|
||||||
\`\` \`c ++
|
```cpp
|
||||||
|
|
||||||
# incluir
|
# incluir
|
||||||
|
utilizando namespace std; int main () { para (int i = 0; i <= 1000; i = i + 2) { cout << i << endl; } devuelve 0; }
|
||||||
utilizando namespace std; int main () { para (int i = 0; i <= 1000; i = i + 2) { cout << i << endl; } devuelve 0; } \`\` \`
|
```
|
||||||
|
Reference in New Issue
Block a user