Skip to content

Instantly share code, notes, and snippets.

/program.c Secret

Created October 16, 2017 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3e563798237196795e2a63408d9e87be to your computer and use it in GitHub Desktop.
Save anonymous/3e563798237196795e2a63408d9e87be to your computer and use it in GitHub Desktop.
/*
* Prilagojeno po
* https://gist.github.com/emilyst/1af129c80d5d10cdfbde
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int is_valid(const char* geslo) {
if (strcmp(geslo, "nyan") == 0) {
return 1;
} else {
return 0;
}
}
int main()
{
char* input = malloc(256);
printf("Prosim napiši geslo: ");
scanf("%s", input);
if (is_valid(input)) {
printf("Pravilno!\n");
} else {
printf("Napačno!\n");
}
free(input);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment