Page 802 - IT2
P. 802

printf("le vehicule: %d , %s \n",TC[i].v.immat,TC[i].v.type);
                  }
               }

                   4)
               int rechercher(chauffeur TC[],int n, int code)
               {
                 int i;
                 for(i=0;i<n;i++)
                 {
                    if(TC[i].code==code)
                        return i;
                 }
                 return -1;
               }

                   5)
               int calculer(chauffeur TC[],int n,int code,int annee)
               {
                      int i,nbr;
                      i=rechercher(TC,n,code);
                      if(i!=-1)  {   nbr=annee-TC[i].d.a;   }
                      else {   nbr=0;   }
                      return nbr;
               }

                   6)
               bool supprimer(chauffeur TC[],int *n,int code)
               {
                  int i,j;
                   i=rechercher(TC,*n,code);
                      if(i!=-1)
                      {
                        for(j=i;j<(*n)-1;j++)
                        {
                           TC[j]=TC[j+1];
                        }
                        (*n)--;
                       return true;
                      }
                      else
                      {
                       return false;
                      }
               }

                   7)
               int nombre(chauffeur TC[],int n, int immat)
               {
                       Filière                Epreuve                Session
                                                                                             6/8
                    DI(CDS de 1 à 2)    Synthèse V1(Correction)    Juillet 2016
                                        www.itlearning-settat.com

                                  Email: admission@itlearning-settat.com

                                                  Tél.:0661077812
   797   798   799   800   801   802   803   804   805   806   807