Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include "header.h"
- #include <string.h>
- void saisir(demande *d)
- {
- int code;
- demande dd;
- char dest[50];
- char date[20];
- printf("\nCode: ");
- scanf("%d",&dd.code);
- printf("\nDestination: ");
- fflush(stdin);
- gets(dd.dest);
- printf("\nDate: ");
- fflush(stdin);
- gets(dd.date);
- (*d) = dd;
- }
- arbre inserer(arbre a, demande d)
- {
- if(a==NULL)
- {
- a->d = d;
- }
- else
- {
- if(d.code > a->d.code)
- {
- a->ABD=inserer(a->ABD,d);
- }
- else
- {
- a->ABG=inserer(a->ABG,d);
- }
- return(a);
- }
- }
- int main()
- {
- int choix;
- demande d;
- arbre *a;
- do
- {
- do
- {
- printf("\nChoix: 1. Inserer: \n");
- scanf("%d",&choix);
- }while((choix < 0)||(choix>4));
- switch(choix)
- {
- case 1: saisir(&d);
- a=inserer(a, d);
- break;
- }
- }while(!(choix == 0));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement