update pin

This commit is contained in:
firmianay
2017-08-08 23:25:51 +08:00
parent 5721728369
commit c7f996ee95
6 changed files with 123 additions and 6 deletions

18
src/Others/5.2_pin.c Normal file
View 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");
}
}