电脑问题求助!悬关!
  • 板块灌水区
  • 楼主Hanrui1206
  • 当前回复15
  • 已保存回复15
  • 发布时间2024/7/20 22:50
  • 上次更新2024/7/21 09:16:59
查看原帖
电脑问题求助!悬关!
1283944
Hanrui1206楼主2024/7/20 22:50

刚刚自己写了一个程序,编译后就: 有没有大佬知道怎么办?

代码

#include <bits/stdc++.h>
#include <windows.h>
#include <conio.h>
#define Password "123456"
using namespace std;
int s;
char ch;
string str;
string op, _op_;

int main() {
	srand(time(NULL));
	cout << "请输入密码:";
	while (1) {
		ch = getch();
		str += ch;
		system("cls");
		cout << "请输入密码:";
		s ++;
		for (int i = 1; i < s; i ++) {
			cout << '*';
		}
		if (ch == '\b') {
			str.erase(s - 2, 2);
			s --;
			system("cls");
			cout << "请输入密码:";
			for (int i = 1; i < s; i ++) {
				cout << '*';
			}
			s --;
		}
		cout << ch;
		if (str == Password) {
			system("cls");
			cout << "密码正确。";
			Sleep(500);
			break;
		}
	}
	for (double i = 0; i < 100; i += (rand() % 5000 + 1) / 500.0) {
		printf("%2lf%%", i);
		Sleep(5);
		system("cls");
	}
	cout << "100%";
	const char* folderPath = "C:\\Users\\yp198\\Desktop\\";
    system(("start explorer " + std::string(folderPath)).c_str());
}
2024/7/20 22:50
加载中...