Another update from ingydotnet^djgoku

This commit is contained in:
Ingy döt Net 2015-11-18 06:14:39 +00:00
parent 91df62d461
commit 948b86eafa
7604 changed files with 108452 additions and 22726 deletions

View file

@ -1,14 +1,13 @@
use std::io;
use std::env;
fn main() {
#![allow(unstable)] // Currently required whilst Rust 1.0 is finalised
let a: i32 = from_str(io::stdin().read_line().unwrap().trim().as_slice()).unwrap();
let b: i32 = from_str(io::stdin().read_line().unwrap().trim().as_slice()).unwrap();
let args: Vec<_> = env::args().collect();
let a = args[1].parse::<i32>().unwrap();
let b = args[2].parse::<i32>().unwrap();
let sum = a + b;
println!("a + b = {0}" , sum);
println!("a - b = {0}" , a - b);
println!("a * b = {0}" , a * b);
println!("quotient of a / b = {0}" , a / b); // truncates towards 0
println!("remainder of a / b = {0}" , a % b); // same sign as first operand
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
}