⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pr04006.cpp

📁 c++编程宝典源码及Quincy99编译器 是《标准C++编程宝典》电子工业出版社的光盘
💻 CPP
字号:
////////////////////////////////////////
// File Name: pr04006.cpp
////////////////////////////////////////
#include <iostream>

// Prototypes
void DisplayMenu();
int GetSelection();

////////////////////////////////////////
// The main() function.
////////////////////////////////////////
int main()
{
    // Display the menu.
    DisplayMenu();

    // Get the menu selection.
    int selection;
    selection = GetSelection();

    // Select the matching process
    switch (selection)
    {
        case 1:
            std::cout << "Processing Receivables" << std::endl;
            break;
        case 2:
            std::cout << "Processing Payables" << std::endl;
            break;
        case 3:
            std::cout << "Quitting" << std::endl;
            break;
        default:
            std::cout << "\aInvalid selection" << std::endl;
            break;
    }

    return 0;
}

////////////////////////////////////////
// Display a menu.
////////////////////////////////////////
void DisplayMenu()
{
    std::cout << "--- Menu ---" << endl;
    std::cout << "1=Receivables" << endl;
    std::cout << "2=Payables" << endl;
    std::cout << "3=Quit" << endl;
}

////////////////////////////////////////
// Read a menu selection from the
// keyboard.
////////////////////////////////////////
int GetSelection()
{
    int selection;
    std::cout << "Enter Selection: ";
    std::cin >> selection;

    return selection;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -