OOP_IO-2x_2023-mirror/Rust/lab_1/src/main.rs

21 lines
365 B
Rust
Raw Normal View History

2023-05-06 23:18:57 +03:00
fn main() {
// use text_io::scan;
use text_io::read;
2023-05-06 23:44:34 +03:00
print!("Enter m: ");
let m: f32 = read!();
2023-05-06 23:18:57 +03:00
2023-05-06 23:44:34 +03:00
print!("Enter n: ");
let n: f32 = read!();
2023-05-06 23:18:57 +03:00
2023-05-06 23:44:34 +03:00
print!("Enter a: ");
let a: f32 = read!();
2023-05-06 23:18:57 +03:00
2023-05-06 23:44:34 +03:00
print!("Enter b: ");
let b: f32 = read!();
let s: f32 = ((b + m) / 2.0) * (m - b + 1.0) * (n - a + 1.0);
println!("S= {}", s);
2023-05-06 23:18:57 +03:00
}