#include #include "dessin.h" using namespace std; void afficher_n_caractere( unsigned int nombre_etoiles, char caractere ) { for ( unsigned int i = 0; i < nombre_etoiles; i++ ) { cout << caractere; } } void triangle_croissant( unsigned int taille ) { for ( unsigned int i = 1; i <= taille; i++ ) { afficher_n_caractere(i, '*'); cout << endl; } } void triangle_decroissant( unsigned int taille ) { for ( unsigned int i = taille; i >= 1; i-- ) { afficher_n_caractere(i, '*'); cout << endl; } } void sapin( unsigned int taille ) { unsigned int nombre_espaces; unsigned int nombre_etoiles = 1; unsigned int nombre_espaces_tronc = taille - 1; for (unsigned int i = 0; i < taille; i++) { nombre_espaces = taille - i; afficher_n_caractere(nombre_espaces, ' '); afficher_n_caractere(nombre_etoiles, '*'); cout << endl; nombre_etoiles += 2; } afficher_n_caractere(nombre_espaces_tronc, ' '); cout << "|_|" << endl; }