Sha256: 70d2c2985c169ea65c35f903ece2046b0e360e48acccebf0bb9579726065a33a
Contents?: true
Size: 572 Bytes
Versions: 10
Compression:
Stored size: 572 Bytes
Contents
Note that this code cannot be run within the [http://play.rust-lang.org Rust playpen] as it does not support console input. use std::env; fn main() { let args: Vec<_> = env::args().collect(); let a = args[1].parse::<i32>().unwrap(); let b = args[2].parse::<i32>().unwrap(); println!("sum: {}", a + b); println!("difference: {}", a - b); println!("product: {}", a * b); println!("integer quotient: {}", a / b); // truncates towards zero println!("remainder: {}", a % b); // same sign as first operand }
Version data entries
10 entries across 7 versions & 1 rubygems