//https://kaisery.github.io/trpl-zh-cn/ch03-02-data-types.html
fn main() {
println!("Hello, world!");
//标量(scalar)类型代表一个单独的值。Rust 有四种基本的标量类型:整型、浮点型、布尔类型和字符类型。
// 你可能在其他语言中见过它们。让我们深入了解它们在 Rust 中是如何工作的。
//数值类型 整型 浮点
let a = 2;
println!("a :{a}");
let b = 2.0;
let c:f32 = 3.0;
let sum = 5 + 10;
let diff = 95.5-4.3;
let product = 4*30;
let quotient = 56.7/32.2;
let truncated = -5/3;
let remainder = 43%5;
println!("remainder :{remainder}");
//布尔类型
let t = true;
let f:bool = false;
println!("t:{t} f:{f}");
//字符类型
let str1 = 'z';
let z_al :char = 'Z';
let black_hat = '
标签:01,al,类型,let,println,remainder,Rust
From: https://www.cnblogs.com/ukzq/p/18135107