fork(6) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. int check_authentication(char *password) {
  6. int auth_flag = 0;
  7. char password_buffer[16];
  8.  
  9. strcpy(password_buffer, password);
  10.  
  11. if(strcmp(password_buffer, "brillig") == 0)
  12. auth_flag = 1;
  13. if(strcmp(password_buffer, "outgrabe") == 0)
  14. auth_flag = 1;
  15.  
  16. return auth_flag;
  17. }
  18.  
  19. int main(int argc, char *argv[]) {
  20. char pwd[100];
  21. scanf("%s", pwd);
  22. if(check_authentication(pwd)) {
  23. printf("\n-=-=-=-=-=-=-=-=-=-=-=-=-=-\n");
  24. printf(" Access Granted.\n");
  25. printf("-=-=-=-=-=-=-=-=-=-=-=-=-=-\n");
  26. } else {
  27. printf("\nAccess Denied.\n");
  28. }
  29. }
Success #stdin #stdout 0s 2116KB
stdin
AAAAAAAAAAAAAAA
stdout
Access Denied.