MIPI_AdvancedC_FRTK/Lect6/71.c

20 lines
359 B
C
Raw Permalink Normal View History

2024-11-14 08:45:50 +03:00
#include <stdio.h>
#include <string.h>
_Bool checkPass(char *p) {
if(strcmp(p,"secret")==0)
return 1;
return 0;
}
int main(void){
char password[100];
printf("Input your password: ");
scanf("%s",password);
if(checkPass(password))
printf("Access granted\n");
else
printf("Access denied\n");
return 0;
}