main.cpp
来自「栈的应用—Polish Calculator」· C++ 代码 · 共 33 行
CPP
33 行
#include<iostream.h>
#include"PolishCal.h"
void main()
/*
Post: The program has executed simple arithmetic
commands entered by the user.
Uses: The class Stack and the functions
introduction, instructions, do_command, and get_command.
*/
{
MyStack stored_numbers;
void introduction();
void instructions();
introduction();
instructions();
while (do_command(get_command(), stored_numbers));
}
void introduction()
{
cout<<"This is a reverse Polish Calculator."<<endl;
}
void instructions()
{
cout << "Please enter a valid command:" << endl
<< "[?]push to stack [=]print top" << endl
<< "[+] [-] [*] [/] are arithmetic operations" << endl
<< "[Q]uit." << endl;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?