semaine-3

This commit is contained in:
Théo 2023-10-04 21:22:46 +02:00
parent cddad223f8
commit 32cd61dadb
3 changed files with 54 additions and 0 deletions

15
semaine-3/boolean/main.c Normal file
View file

@ -0,0 +1,15 @@
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int monAge = 47, majeur = monAge > 17;
if (majeur) {
printf("Vous êtes majeur");
} else {
printf("Vous êtes mineur");
}
return EXIT_SUCCESS;
}

22
semaine-3/neurones/main.c Normal file
View file

@ -0,0 +1,22 @@
#include <stdio.h>
#include <stdlib.h>
#define PERTE 10000
#define NEURONES 1000000000
#define AGE 47
int main(void) {
int restant = NEURONES + (AGE * -PERTE);
if (restant < 99000000) {
printf("C'est mal parti !");
} else if (restant > NEURONES) {
printf("Comment as-tu fais pour en gagner ?");
} else {
printf("Ca devrait le faire.");
}
return EXIT_SUCCESS;
}

View file

@ -0,0 +1,17 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
char aPassword[30] = "SuperSecurePassword1234!",
uPassword[30] = "SuperSecurePassword1234 !";
if (!strcmp(aPassword, uPassword)) {
printf("Bienvenue");
} else {
printf("Alerte");
}
return EXIT_SUCCESS;
}