hkkim_lib_wikibooks_rpn_test

Crates.iohkkim_lib_wikibooks_rpn_test
lib.rshkkim_lib_wikibooks_rpn_test
version0.1.1
sourcesrc
created_at2024-01-11 06:42:12.568066
updated_at2024-01-11 06:52:39.205671
descriptionRPN(Reverse Polish Notatio) library
homepagehttps://github.com/studian
repository
max_upload_size
id1095931
size3,588
Hyunkoo Kim (studian)

documentation

README

RPN(Reverse Polish Notation) Calc

Reverse Polish notation (RPN) Calc.

Example

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);
}
Commit count: 0

cargo fmt