cpp/tp1/main.cpp
2021-12-18 14:57:21 +01:00

44 lines
2.2 KiB
C++
Executable file

#include <iostream>
#include "pile.h"
int main()
{
int tableauJeton[2]={10,12};
t_pile pileA;
std :: cout << "pileA.initialiser();" << std :: endl;
std :: cout << "Sommet :" << pileA.sommet() << std :: endl;
std :: cout << "Dernier Jeton :" << pileA.dernier_jeton() << std :: endl << std :: endl;
pileA.empiler(10);
std :: cout << "pileA.empiler(10);" << std :: endl;
std :: cout << "Sommet :" << pileA.sommet() << std :: endl;
std :: cout << "Dernier Jeton :" << pileA.dernier_jeton() << std :: endl << std :: endl;
pileA.empiler(15);
std :: cout << "pileA.empiler(15);" << std :: endl;
std :: cout << "Sommet :" << pileA.sommet() << std :: endl;
std :: cout << "Dernier Jeton :" << pileA.dernier_jeton() << std :: endl << std :: endl;
pileA.empiler(20);
std :: cout << "pileA.empiler(20);" << std :: endl;
std :: cout << "Sommet :" << pileA.sommet() << std :: endl;
std :: cout << "Dernier Jeton :" << pileA.dernier_jeton() << std :: endl << std :: endl;
pileA.depiler();
std :: cout << "pileA.depiler();" << std :: endl;
std :: cout << "Sommet :" << pileA.sommet() << std :: endl;
std :: cout << "Dernier Jeton :" << pileA.dernier_jeton() << std :: endl << std :: endl;
t_pile pileB(2,tableauJeton);
std :: cout << std :: endl << "t_pile pileB(2,tableauJeton);" << std :: endl;
std :: cout << "Sommet :" << pileB.sommet() << std :: endl;
std :: cout << "Dernier Jeton :" << pileB.dernier_jeton() << std :: endl << std :: endl;
pileB.empiler(30);
std :: cout << "pileB.empiler(30);" << std :: endl;
std :: cout << "Sommet :" << pileB.sommet() << std :: endl;
std :: cout << "Dernier Jeton :" << pileB.dernier_jeton() << std :: endl << std :: endl;
pileB.depiler();
std :: cout << "pileB.depiler();" << std :: endl;
std :: cout << "Sommet :" << pileB.sommet() << std :: endl;
std :: cout << "Dernier Jeton :" << pileB.dernier_jeton() << std :: endl << std :: endl;
pileB.depiler();
std :: cout << "pileB.depiler();" << std :: endl;
std :: cout << "Sommet :" << pileB.sommet() << std :: endl;
std :: cout << "Dernier Jeton :" << pileB.dernier_jeton() << std :: endl << std :: endl;
return 0;
}