From 9fe033ea88c2f705ec18c232873d056e0c229d72 Mon Sep 17 00:00:00 2001 From: Gaspard Coulet Date: Wed, 28 Apr 2021 23:05:53 +0200 Subject: Initial commit --- sem_2/HLIN202/TP/TP3-4/ex9/exo9 | Bin 0 -> 9276 bytes sem_2/HLIN202/TP/TP3-4/ex9/exo9.cpp | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 sem_2/HLIN202/TP/TP3-4/ex9/exo9 create mode 100644 sem_2/HLIN202/TP/TP3-4/ex9/exo9.cpp (limited to 'sem_2/HLIN202/TP/TP3-4/ex9') diff --git a/sem_2/HLIN202/TP/TP3-4/ex9/exo9 b/sem_2/HLIN202/TP/TP3-4/ex9/exo9 new file mode 100644 index 0000000..490551d Binary files /dev/null and b/sem_2/HLIN202/TP/TP3-4/ex9/exo9 differ diff --git a/sem_2/HLIN202/TP/TP3-4/ex9/exo9.cpp b/sem_2/HLIN202/TP/TP3-4/ex9/exo9.cpp new file mode 100644 index 0000000..4d038ce --- /dev/null +++ b/sem_2/HLIN202/TP/TP3-4/ex9/exo9.cpp @@ -0,0 +1,29 @@ +#include + +void arbre ( int base) { + if (base%2==1) { + int espaces = (base-1)/2; + int nb=1; + int etage = base / 2 +1; + for ( int i=1; i<=etage; i ++) { + for ( int j=1; j<=espaces; j ++) { + std::cout<<" "; + } + + for (int k=1; k<=nb; k ++) { + std::cout<<"*"; + } + std::cout<>n; + arbre(n); + return 0; +} -- cgit v1.2.3