mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-23 12:39:42 +00:00
20 lines
262 B
Markdown
20 lines
262 B
Markdown
1.
|
|
|
|
```rust
|
|
fn main() {
|
|
let s1 = "hello";
|
|
/* Fill in the blank */
|
|
let s = format!("{}, world!", s1);
|
|
assert_eq!(s, "hello, world!");
|
|
}
|
|
```
|
|
|
|
2.
|
|
|
|
```rust
|
|
fn main() {
|
|
print!("hello world, ");
|
|
println!("I am");
|
|
println!("Sunface!");
|
|
}
|
|
``` |