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

📄 cpp05.cpp

📁 C++参考书
💻 CPP
字号:

// Coded by plusir -- Dec.27.2002.
// Standard C++ Bible -- (P91-4-5)

#include <iostream>
using namespace std ;

void displayMenu( void ) ;
int getSelection( void ) ;

int main()
{
	displayMenu() ;

	int selection = getSelection() ;

	if ( selection == 1 )
		cout << "Processing Receivables" << endl ;
	else if ( selection == 2 )
		cout << "Processing Payables" << endl ;
	else if ( selection == 3 )
		cout << "Quitting" << endl ;
	else
		cout << "\aInvalid selection" << endl ;

	return 0 ;
}

void displayMenu( void )
{
	cout << "--- Menu ---" << endl ;
	cout << " 1 - Receivalbes" << endl ;
	cout << " 2 - Payables" << endl ;
	cout << " 3 - Quit" << endl ;
}

int getSelection( void )
{
	int selection ;
	cout << "Enter a integer: " ;
	cin >> selection ;

	return selection ;
}

⌨️ 快捷键说明

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