Crates.io | hkkim_lib_wikibooks_rpn_test |
lib.rs | hkkim_lib_wikibooks_rpn_test |
version | 0.1.1 |
source | src |
created_at | 2024-01-11 06:42:12.568066 |
updated_at | 2024-01-11 06:52:39.205671 |
description | RPN(Reverse Polish Notatio) library |
homepage | https://github.com/studian |
repository | |
max_upload_size | |
id | 1095931 |
size | 3,588 |
Reverse Polish notation (RPN) Calc.
fn main() {
let src = String::from("1 2 + 3 * ");
let a = hkkim_lib_wikibooks_rpn_test::eval(src).unwrap();
println!("{}", a); // →9
}
fn main() {
let result = hkkim_lib_wikibooks_rpn_test::eval_str("1 2 3 * +");
println!("{}", result); // →7
}
use hkkim_lib_wikibooks_rpn_test as rpn_calc;
fn main() {
let src = "2 3 4 * +".to_string();
let ans = rpn_calc::eval(src).unwrap();
println!("{}", ans);
}