mirror of https://github.com/01-edu/public.git
docs(division_and_remainder): correct grammar
This commit is contained in:
parent
2f50e3c413
commit
f226f3b98a
|
@ -2,21 +2,10 @@
|
||||||
|
|
||||||
### Instructions
|
### Instructions
|
||||||
|
|
||||||
Create a **function** `divide` that receives two i32 and returns a tuple in which the first element is the result of the integer division between the two numbers and the second is the remainder of the division.
|
Create a **function** named `divide` that receives two `i32` and returns a `tuple`. The first element is the result of the integer division between the two numbers, and the second is the remainder of the division.
|
||||||
|
|
||||||
### Notions
|
|
||||||
|
|
||||||
- [The Tuple Type](https://doc.rust-lang.org/stable/book/ch03-02-data-types.html?highlight=accessing%20a%20tuple#compound-types)
|
|
||||||
|
|
||||||
- [Tuples](https://doc.rust-lang.org/rust-by-example/primitives/tuples.html)
|
|
||||||
|
|
||||||
- [Tuple Structs without Named Fields](https://doc.rust-lang.org/stable/book/ch05-01-defining-structs.html?highlight=tuple#using-tuple-structs-without-named-fields-to-create-different-types)
|
|
||||||
|
|
||||||
### Expected Function
|
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
pub fn divide(x: i32, y: i32) -> (i32, i32) {
|
pub fn divide(x: i32, y: i32) -> (i32, i32) {
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -45,3 +34,11 @@ $ cargo run
|
||||||
9/4: division = 2, remainder = 1
|
9/4: division = 2, remainder = 1
|
||||||
$
|
$
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Notions
|
||||||
|
|
||||||
|
- [The Tuple Type](https://doc.rust-lang.org/stable/book/ch03-02-data-types.html?highlight=accessing%20a%20tuple#compound-types)
|
||||||
|
|
||||||
|
- [Tuples](https://doc.rust-lang.org/rust-by-example/primitives/tuples.html)
|
||||||
|
|
||||||
|
- [Tuple Structs without Named Fields](https://doc.rust-lang.org/stable/book/ch05-01-defining-structs.html?highlight=tuple#using-tuple-structs-without-named-fields-to-create-different-types)
|
||||||
|
|
Loading…
Reference in New Issue