#include <iostream>
#include <string> #include <windows.h> #define WIDTH 40 #define HEIGHT 15 using namespace std; void init() { //初始化终端界面 char cmd[128]; sprintf_s(cmd, "mode con cols=%d lines=%d", WIDTH, HEIGHT); system(cmd); } void login() { //登录账号 string name; string pwd; while (1) { system("cls"); cout << "请输入账号:"; cin >> name; cout << "请输入密码:"; cin >> pwd; if (name == "54hk" && pwd == "123456") { break; } else { cout << "用户名或密码错误!" << endl; system("pause"); } } } void menuShow() { //菜单显示 system("cls"); cout << "1.网站404攻击" << endl; cout << "2.网站篡改攻击" << endl; cout << "3.网站攻击修复" << endl; cout << "4.查看攻击记录" << endl; cout << "5.退出" << endl; } int main() { init(); login(); menuShow(); system("pause"); return 0; }
标签:界面,cout,cmd,C++,pwd,终端,include,name From: https://www.cnblogs.com/smartlearn/p/16593355.html