DEV_BUT1/DEV1.1S/CM3/reduction.c
2023-02-08 11:18:16 +01:00

26 lines
437 B
C

#include <stdio.h>
#include <stdlib.h>
#include <stack.h>
#include <stack.c>
void sans_zero(stack pile){
int stock;
while (empty(pile) == 0){
stock = pop(pile);
if(stock != 0){
push(pile, stock)
}
}
}
int main(int argc, char const *argv[])
{
int pile = create_stack()
int push = push(pile, 1);
push = push(pile , 2);
push = push(pile , 0);
push = push(pile , 1);
push = push(pile , 0);
sans_zero(pile);
return 0;
}