Last active
November 12, 2021 14:40
-
-
Save Thesola10/bc76ade7a7c3186bb1ffae3b293caccf to your computer and use it in GitHub Desktop.
Vous aussi, programmez en fran-C !
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
#define vide void | |
#define si if | |
#define sinon else | |
#define retourner return | |
#define pour for | |
#define tantque while | |
#define faire do | |
#define booleen bool | |
#define entier int | |
#define caractere char | |
#define flottant float | |
#define court short | |
#define nonsigne unsigned | |
#define registre register | |
#define bascule switch | |
#define cas case | |
#define defaut default | |
#define sortie break | |
#define aller goto | |
#define vrai true | |
#define faux false |
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
#include <stdio.h> | |
#define imprimef printf | |
#define liref scanf | |
#define posecara putchar | |
#include <stdbool.h> | |
#include "francais.h" | |
entier main(entier argc, caractere *argv[]) | |
{ | |
caractere nom[20]; | |
entier etoiles; | |
booleen valide = faux; | |
tantque (!valide) { | |
imprimef("Quel est ton nom ? "); | |
si (liref("%s", nom) > 0) | |
valide = vrai; | |
} | |
valide = faux; | |
imprimef("Bonjour, %s!\n", nom); | |
tantque (!valide) { | |
imprimef("Combien d'étoiles veux-tu ? "); | |
liref("%d", &etoiles); | |
si (etoiles >= 0 && etoiles <= 200) | |
valide = vrai; | |
} | |
pour (; etoiles; etoiles--) | |
posecara('*'); | |
imprimef("\nAu revoir, %s\n", nom); | |
retourner 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment