摘要: 首先明确摄氏温度与华氏温度的转换规则 华氏度=摄氏度*1.8+32 摄氏度=(华氏度-32)/1.8 然后就可以开始编码,首先要引入标准库中的io模块,因为我们要让用户输入一个温度, 当用户输入后,我们潜规则默认后缀带C为摄氏度,带F为华氏度。 以下为编程注意点: 一、**stdin().read_ 阅读全文
posted @ 2021-03-02 21:00 诡局 阅读(545) 评论(0) 推荐(0)
摘要: 用rust打印一个99乘法表 fn main() { for i in 1..10 { for j in 1..i + 1 { print!("{} x {} = {}\t", j, i, j * i); } println!(); } } 运行 阅读全文
posted @ 2020-10-29 14:51 诡局 阅读(190) 评论(0) 推荐(0)
摘要: 转载自B站 https://www.bilibili.com/read/cv5512692 https://wallhaven.cc/ https://unsplash.com http://wallls.com/tag/lights/ https://wall.alphacoders.com/?l 阅读全文
posted @ 2020-09-24 11:38 诡局 阅读(231) 评论(0) 推荐(0)
摘要: 出处《深入浅出Rust》 Rust中一系列的宏,如 println! format! write! writeln! 等,都是用的同样的格式控制规则 fn main() { println!("{}", 1); //默认用法,打印display println!("{:o}", 9); //八进制 阅读全文
posted @ 2020-09-21 11:20 诡局 阅读(610) 评论(0) 推荐(0)
摘要: 一、官方学习资料 1. 官网地址:https://www.rust-lang.org/ 2. Rust编程语言(运行 rustup docs 可以打开离线版):https://doc.rust-lang.org/book/title-page.html 3. Rust示例练习项目rustlings: 阅读全文
posted @ 2020-09-21 10:23 诡局 阅读(1182) 评论(0) 推荐(0)