add chapter [println and format]

This commit is contained in:
sunface
2022-03-15 20:05:03 +08:00
parent affa25fc54
commit 112f6b26ac
4 changed files with 57 additions and 13 deletions

View File

@ -0,0 +1,18 @@
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!");
}
```