-
-
Save anonymous/3e563798237196795e2a63408d9e87be to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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