#include #include "functions.h" int saisie(int min,int max){ int n; do{scanf("%d",&n); }while(nmax); return n; } int ctoi(char c){ if(c>'9' || c<'0') return -1; return c-'0'; } void clear(){ #ifdef WIN32 system("cls"); #else #ifdef UNIX system("clear"); #else for(int i=0;i<30;i++)printf("\n"); #endif #endif } void pause(){ getchar(); printf("tapez la touche entree"); fflush(stdout); while(getchar()!='\n'); } //stringLIFO stringLIFO init_stringLIFO(){return NULL;} int is_emptyLIFO(stringLIFO list){return list==NULL;} void delete_LIFO(stringLIFO*list){ while(!is_emptyLIFO(*list)) free(pop(list)); } string top(stringLIFO list){return is_emptyLIFO(list)?NULL:list->val;} void push(stringLIFO *list,string s){ cell*c=malloc(sizeof(cell)); c->val=calloc((strlen(s)+1),sizeof(char)); strcpy(c->val,s); c->next=*list; *list=c; } string pop(stringLIFO*list){ string ret=NULL; if(!is_emptyLIFO(*list)){ cell*c=(*list)->next; ret=(*list)->val; free(*list); *list=c; } return ret; }