exit.cpp

来自「c语言教程源码」· C++ 代码 · 共 29 行

CPP
29
字号
//这个程序在本书所带软盘中,文件名为EXIT.CPP
//这个程序演示exit()语句的应用。

#include <iostream.h>
#include <conio.h>
#include <stdlib.h>

void main(void)
{
	char password[30];

	cout << "Please enter your password: ";
	gets(password);

	if (password == "computer")
		call_a_function();
	else {
		cout << endl << "Please try again...";
		gets(password);

		if (password == "computer")
			call_a_function();
		else
			exit(0);
	}
	.
	.
	.
}

⌨️ 快捷键说明

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