Skip to content

Commit

Permalink
发布博客,时间:2024/12/12 16:45:26
Browse files Browse the repository at this point in the history
  • Loading branch information
whp98 committed Dec 12, 2024
1 parent 5c66f6f commit 435b58b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/Rust语言/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Rust语言
- [rust语言支持中文变量吗](./rust语言支持中文变量吗.md)
- [使用Rust编写Hello-World](./使用Rust编写Hello-World.md)
- [Rust介绍](./rust介绍.md)
26 changes: 26 additions & 0 deletions docs/Rust语言/rust语言支持中文变量吗.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# rust语言支持中文变量吗

支持

示例代码如下


```rust
use std::io;
use rand::Rng;
fn main() {
println!("Guass the number!");
println!("请输入出猜测的数字: ");
let mut guess = String::new();
let 密码 = rand::thread_rng().gen_range(1..=100);
println!("密码是{}",密码);
let count = io::stdin()
.read_line(&mut guess)
.expect("failed to read line");
println!("你输入的是: {}", guess);
println!("你输入了{}个字符", count);
let x = 5;
let y = 10;
println!("x = {x} and y + 2 = {}", y + 2);
}
```
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# 目录
- [Rust语言](./Rust语言/)
- [社会认知](./社会认知/)
- [后端开发](./后端开发/)
- [AI相关](./AI相关/)
Expand All @@ -21,6 +22,5 @@
- [数据库](./数据库/)
- [系统架构](./系统架构/)
- [Windows系统](./Windows系统/)
- [Rust语言](./Rust语言/)
- [算法面试](./算法面试/)
- [VitePress 博客](./Readme.md)

0 comments on commit 435b58b

Please sign in to comment.