20191120控制台重复验证 带清屏功能和登陆成功后清除用户名密码

#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main() {
	string strName;
	string strPWD;
	while (1) {
		system("cls");//清除控制台程序
		cout << "请输入用户名:" ;
		cin >> strName;
		cout << "请输入密码:" << endl;
		cin >> strPWD;

		if (strName == "54hk" && strPWD == "123456") {
			system("cls");//清除控制台程序
			cout << "1-网站DNS攻击!\n" << endl;
			cout << "2-网站404攻击!\n" << endl;
			cout << "3-网站攻击修复!\n" << endl;
			cout << "4-查看攻击记录!\n" << endl;
			cout << "5.退出!\n" << endl;
			break;//退出验证循环
		}
		else {
			cout << "输入的用户名或者密码不正确!" << endl;
		}
	}

	system("pause");
	return 0;
}

发布了51 篇原创文章 · 获赞 0 · 访问量 569

猜你喜欢

转载自blog.csdn.net/weixin_40071289/article/details/103170971