#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
int main() {
	int i = 1;
	char password[6] = {0};
	for (; i <= 3;++i) {
		printf("请输入密码\n");
		scanf("%s", password);
		if (strcmp(password, "123abc") == 0) {
			break;
		}
	}
	if (i != 4) {
		printf("登录成功\n");
	}
	if (i == 4) {
		printf("登录失败\n");
	}

	system("pause");
	return 0;
}

三次密码输入
三次密码输入

相关文章:

  • 2022-02-02
  • 2021-06-03
  • 2021-08-24
  • 2021-12-20
  • 2021-10-17
  • 2022-01-07
  • 2021-11-14
猜你喜欢
  • 2021-11-09
  • 2021-09-30
  • 2021-07-27
  • 2022-12-23
  • 2021-07-04
  • 2021-06-05
相关资源
相似解决方案