mirror of
https://github.com/nganhkhoa/CTF-All-In-One.git
synced 2025-06-23 11:45:04 +07:00
update pin
This commit is contained in:
18
src/Others/5.2_pin.c
Normal file
18
src/Others/5.2_pin.c
Normal file
@ -0,0 +1,18 @@
|
||||
#include<stdio.h>
|
||||
#include<string.h>
|
||||
void main() {
|
||||
char pwd[] = "abc123";
|
||||
char str[128];
|
||||
int flag = 1;
|
||||
scanf("%s", str);
|
||||
for (int i=0; i<=strlen(pwd); i++) {
|
||||
if (pwd[i]!=str[i] || str[i]=='\0'&&pwd[i]!='\0' || str[i]!='\0'&&pwd[i]=='\0') {
|
||||
flag = 0;
|
||||
}
|
||||
}
|
||||
if (flag==0) {
|
||||
printf("Bad!\n");
|
||||
} else {
|
||||
printf("Good!\n");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user