29 lines
509 B
C
29 lines
509 B
C
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <string.h>
|
||
|
|
||
|
int main(void){
|
||
|
int i=0;
|
||
|
int nb_juste=0;
|
||
|
char mdp_secret[26] = {'J','s','a','i','s','p','a','s','\0'};
|
||
|
char mot_de_passe[26];
|
||
|
while(i<26){
|
||
|
mot_de_passe[i]= getchar();
|
||
|
if (mot_de_passe[i]==mdp_secret[i]){
|
||
|
nb_juste++;
|
||
|
}
|
||
|
if(mot_de_passe[i]==13){
|
||
|
break;
|
||
|
}
|
||
|
i++;
|
||
|
if (nb_juste==1){
|
||
|
printf("Accès accordé\n");
|
||
|
break;
|
||
|
}
|
||
|
else {
|
||
|
printf("Accès refusé\n");
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
}
|