First commit

This commit is contained in:
2026-04-08 20:11:20 +02:00
parent 10fe469c10
commit 79f15536a1
861 changed files with 135610 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
*
***
*****
*******
*********
|_|
*
***
*****
*******
*********
***********
|_|
*
***
|_|
*
|_|
|_|

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,64 @@
#include <iostream>
#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;
}

View File

@@ -0,0 +1,15 @@
void triangle_croissant(
unsigned int taille
);
void triangle_decroissant(
unsigned int taille
);
void sapin(
unsigned int taille
);
void afficher_n_caractere(
unsigned int nombre_etoiles
);

Binary file not shown.

View File

@@ -0,0 +1,21 @@
#include <iostream>
#include "dessin.h"
using namespace std;
int main() {
unsigned int taille;
cout << "Saisir la taille des triangle" << endl;
cin >> taille;
triangle_croissant(taille);
cout << endl;
triangle_decroissant(taille);
cout << endl;
sapin(taille);
return 0;
}