DEV_BUT1/DEV1.1/TP11/lecture.c

21 lines
327 B
C
Raw Normal View History

2022-10-18 14:50:36 +02:00
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
char mdp[6] = "salut";
char essai[26]= "";
int i;
do{
essai[i] = getchar();
}while(essai[i++] != '\n' && i<26);
essai[5] = 0;
if (strcmp(mdp,essai) == 0){
printf("BONMDP\n");
}
else{
printf("PASBON\n");
}
return EXIT_SUCCESS;
}