mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2025-04-22 13:38:04 +08:00
13 lines
216 B
Rust
13 lines
216 B
Rust
fn main() {
|
|
let rect1 = (30, 50);
|
|
|
|
println!(
|
|
"The area of the rectangle is {} square pixels.",
|
|
area(rect1)
|
|
);
|
|
}
|
|
|
|
fn area(dimensions: (u32, u32)) -> u32 {
|
|
dimensions.0 * dimensions.1
|
|
}
|