Skip to content · ⁨الانتقال إلى المحتوى⁩

RPN calculator · ⁨آلة حاسبة RPN⁩

English

RPN calculator

In Reverse Polish Notation the operator comes after its two numbers: 2 3 + means 2 + 3, and 2 3 4 * + means 2 + (3 * 4) = 14. No brackets needed.

Use a stack (a list). Read tokens left to right: push numbers; when you hit an operator, pop the top two, combine them (mind the order — the first value popped is the right-hand side), and push the result. The answer is what's left on top.

العربية

الآلة الحاسبة RPN

في الرمز البولندي العكسي، يأتي العامل بعد عدديه: 2 3 + تعني 2 + 3، و2 3 4 * + تعني 2 + (3 * 4) = 14. لا حاجة للأقواس.

استخدم مكدس (قائمة). اقرأ الرمز من اليسار إلى اليمين: ادفع الأعداد؛ عندما تواجه عاملاً، اسحب أعلى عددين، اجمعهما (انتبه للترتيب — القيمة الأولى المسحوبة هي الجانب الأيمن)، ودفع النتيجة. الجواب هو ما يتبقى في الأعلى.

Log in or create account · ⁨تسجيل الدخول أو إنشاء حساب⁩

IGCSE, A-Level & AP