Skip to content

Instantly share code, notes, and snippets.

@heronyang
Last active August 29, 2015 14:09
Show Gist options
  • Save heronyang/8797f6993c8d648e9260 to your computer and use it in GitHub Desktop.
Save heronyang/8797f6993c8d648e9260 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char alpha_bin[4096];
char invalid[]="BINSHbinsh";
int i;
scanf("%s", alpha_bin);
for(i = 0; i < strlen(invalid); i++) {
if(strchr(alpha_bin, invalid[i]) != NULL) {
puts("invalid input");
exit(0);
}
}
(*(void (*)()) alpha_bin)();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment