25 lines
519 B
C
25 lines
519 B
C
#include<stdio.h>
|
|
#include<stdlib.h>
|
|
#include<string.h>
|
|
|
|
int main(int argc, char * argv[]) {
|
|
char real_password[] = "test 1212 34";
|
|
char password[27];
|
|
|
|
for (int i = 1; i < argc; i++) {
|
|
if (i != 1) strcat(password, " ");
|
|
if (strlen(password) + strlen(argv[i]) > 26) {
|
|
puts("Mot de passe trop long !");
|
|
return EXIT_FAILURE;
|
|
}
|
|
strcat(password, argv[i]);
|
|
}
|
|
|
|
if (strcmp(password, real_password)) {
|
|
puts("Authentification réussie.");
|
|
} else puts("Mot de passe incorrect.");
|
|
|
|
return EXIT_SUCCESS;
|
|
}
|
|
|