2023-01-04 15:31:14 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include "pile.h"
|
|
|
|
|
|
|
|
int main(int argc, char const *argv[])
|
|
|
|
{
|
|
|
|
pile *bazar;
|
|
|
|
char input1;
|
|
|
|
char input2;
|
|
|
|
printf(">");
|
|
|
|
scanf("%c%c",&input1,&input2);
|
|
|
|
while(input1!='q')
|
|
|
|
{
|
|
|
|
printf("input1=%c input2=%c\n", input1,input2);
|
|
|
|
if (input1=='+')
|
|
|
|
{
|
|
|
|
push(&bazar,input2);
|
|
|
|
printf("Le charactere %c a été ajouté\n", input2);
|
|
|
|
input1=' ';
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (input1=='-')
|
|
|
|
{
|
|
|
|
printf("Le charactere %c a été supprimé\n",pop(&bazar));
|
|
|
|
input1=' ';
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
printf(">");
|
2023-01-11 14:14:52 +01:00
|
|
|
scanf("%c%c",&input1,&input2);
|
2023-01-04 15:31:14 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
printf("Au revoir\n");
|
|
|
|
return 0;
|
|
|
|
}
|