Add files via upload

This commit is contained in:
BasileiaRhomaion1453
2024-05-17 21:24:49 +08:00
committed by GitHub
parent fe45a7741c
commit 9f3bf4fb87
2 changed files with 34 additions and 0 deletions

BIN
password.txt Normal file

Binary file not shown.

34
password1.c Normal file
View File

@@ -0,0 +1,34 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void attack()
{
printf("ATTACK\n"); //attack函数
system("pause");
}
int fuc(){
//while(1){
char password[6] = "ABCDE";
password[5]='\0';
char str[6];
str[5]='\0';
FILE *fp;
if((fp=fopen("./password.txt","r"))) //打开D盘的password.txt文件
fscanf(fp,"%s",str); //将str的内容写入fp
if(!strncmp(password,str,6))
{ //判断str是否与password相同
printf("OK.\n");
}
else{
printf("NO.\n");
}
return 0;
//} //运行func函数
}
int main()
{
fuc();
return 0;
}