[TOPIK UNIK] HFR Blast! - ZE KONKOUR

HFR Blast! - ZE KONKOUR [TOPIK UNIK] - Jeux Video

Marsh Posté le 27-03-2002 à 12:27:04    

histoire de calmer les esprits! :D  
 
http://membres.lycos.fr/crowfix/HFRBlast.zip
 
632k c'est pas long à charger

 

[jfdsdjhfuetppo]--Message édité par CrowFix--[/jfdsdjhfuetppo]

Reply

Marsh Posté le 27-03-2002 à 12:27:04   

Reply

Marsh Posté le 27-03-2002 à 12:29:45    

c'est koi donc ?

Reply

Marsh Posté le 27-03-2002 à 12:31:45    

syntaxx_error a écrit a écrit :

c'est koi donc ?  




un chti jeu
fait en moins d'une heure alors désolé si c'est pas un grand jeu ;)

 

[jfdsdjhfuetppo]--Message édité par CrowFix--[/jfdsdjhfuetppo]

Reply

Marsh Posté le 27-03-2002 à 12:58:29    

me suis arrete au 11
 
 
dommage q'uon puisse pas mourir ;)


---------------
Enculus de mairde! ©
Reply

Marsh Posté le 27-03-2002 à 12:58:48    

sinon, j'en ai eclaté bcp des xbox ^^


---------------
Enculus de mairde! ©
Reply

Marsh Posté le 27-03-2002 à 13:02:56    

seyar a écrit a écrit :

me suis arrete au 11
 
 
dommage q'uon puisse pas mourir ;)  




si j'ai le courage je ferais un vrai jeu mais je bosse sur un plus gros projet en ce moment. c'était juste histoire de délirer :D

Reply

Marsh Posté le 27-03-2002 à 13:04:04    

http://membres.lycos.fr/crowfix/bullet.bmp
 
http://membres.lycos.fr/crowfix/ebullet.bmp

 

[jfdsdjhfuetppo]--Message édité par CrowFix--[/jfdsdjhfuetppo]

Reply

Marsh Posté le 27-03-2002 à 22:19:34    

un ptit up pour le jeu de l'année :D

Reply

Marsh Posté le 27-03-2002 à 22:29:54    

excellent ;)

Reply

Marsh Posté le 27-03-2002 à 22:50:20    

TRUNKS a écrit a écrit :

excellent ;)  




merci :D  
j'ai même réussi à faire bugger la xbox! j'ai oublié de ré-initialiser les tirs ennemis après leur destruction (quand on se fait tuer, donc) ce qui fait qu'au bout d'un moment y a plus de tirs! ce que c'est de vouloir faire vite pendant le boulot!
 
au passage, pour ceux qui voudraient s'amuser, les graphs sont en accès libre. si vous voulez modifier le jeu à votre gout, rien de plus simple. allez dans le dossier GFX et modifiez!
 
bullet.bmp : tir ami
ebullet.bmp : tir ennemi
enemy.bmp : xbox :D  
ship.bmp : gamecube
title.bmp : l'écran titre
 
respectez juste les 48 pixels de largeur maximum pour les sprites sinon ça risque d'être un peu le bordel

 

[jfdsdjhfuetppo]--Message édité par CrowFix--[/jfdsdjhfuetppo]

Reply

Marsh Posté le 27-03-2002 à 22:50:20   

Reply

Marsh Posté le 27-03-2002 à 22:54:02    

PTDRZZZ
par contre cai pas réaliste,les manettes sont moins grosse que le vaisseau :D

Reply

Marsh Posté le 27-03-2002 à 22:56:24    

Fred2k a écrit a écrit :

PTDRZZZ
par contre cai pas réaliste,les manettes sont moins grosse que le vaisseau :D  




oué, j'y ai pensé après coup! et la gc est aussi grosse que la xbox! pas réaliste du tout :lol:

Reply

Marsh Posté le 28-03-2002 à 00:24:04    

un ptit up pour Stormlord et je vais me coucher! good night :sleep:

Reply

Marsh Posté le 28-03-2002 à 00:48:04    

Pas mal du tout, j'ai vu des écrans titres plus moches ;)  
 
Et dire que t'aurais pu connaître la gloire en le faisant 25 ans plus tôt :D

Reply

Marsh Posté le 28-03-2002 à 07:51:06    

oui mais y a 25 ans la xbox n'était pas encore sortie ;)

Reply

Marsh Posté le 28-03-2002 à 08:17:19    

trop fort  [:tdk04]


---------------
:sol:
Reply

Marsh Posté le 28-03-2002 à 09:09:39    

merchi bokou :jap:  :D

Reply

Marsh Posté le 29-03-2002 à 01:09:05    

Bravo :D Je cherche un programmeur qui voudrait bien adapter Transport Tycoon pour Windows XP :D Quelqu'un interessé ? :)
 
Hellgi

Reply

Marsh Posté le 29-03-2002 à 09:02:20    

Hellgi a écrit a écrit :

Bravo :D Je cherche un programmeur qui voudrait bien adapter Transport Tycoon pour Windows XP :D Quelqu'un interessé ? :)
 
Hellgi  




je ne connais pas ce jeu et je me suis mis à la prog il y a quelques mois seulement alors je ne maitrise pas encore toute la programmation sur pc. j'avais arrêté de programmé en 93 (sur amiga :) ) alors je m'y remets doucement (mais maintenant y a le boulot qui me bouffe tout mon temps libre alors j'avance pas vite).

 

[jfdsdjhfuetppo]--Message édité par CrowFix--[/jfdsdjhfuetppo]

Reply

Marsh Posté le 30-03-2002 à 00:14:54    

10 mode 1:ink 0,0:ink 1,26:ink 2,24:ink 3,1:border 0
20 pen 1:locate 1,1
30 print "Moi, je suis un pro du Basic CPC, alors s'il y a des intéressés... Vous savez où me trouvez ;)"
40 goto 40
run
 
Trop top, le Basic :D  :lol:  :)

Reply

Marsh Posté le 30-03-2002 à 00:19:42    

Stormlord a écrit a écrit :

10 mode 1:ink 0,0:ink 1,26:ink 2,24:ink 3,1:border 0
20 pen 1:locate 1,1
30 print "Moi, je suis un pro du Basic CPC, alors s'il y a des intéressés... Vous savez où me trouvez ;)"
40 goto 40
run
 
Trop top, le Basic :D  :lol:  :)  




wow! du locomotive basic??? ça nous rajeunit pas tout ça ;)

Reply

Marsh Posté le 30-03-2002 à 01:26:23    

Stormlord a écrit a écrit :

10 mode 1:ink 0,0:ink 1,26:ink 2,24:ink 3,1:border 0
20 pen 1:locate 1,1
30 print "Moi, je suis un pro du Basic CPC, alors s'il y a des intéressés... Vous savez où me trouvez ;)"
40 goto 40
run
 
Trop top, le Basic :D  :lol:  :)  




 
10 cls
20 print "bonjours"
30 goto 20
run  
 
 
 
 
 
 
[:misterpinguin]

Reply

Marsh Posté le 30-03-2002 à 09:12:36    

Fred2k a écrit a écrit :

 
 
10 cls
20 print "bonjours"
30 goto 20
run  
 
[:misterpinguin]  




marchera jamais ton programme! y a pas de "s" à bonjour :D

Reply

Marsh Posté le 30-03-2002 à 09:37:18    

#include <conio.h>
#include <stdio.h>
#include <string.h>
 
 
 
struct entreprise
{
int nument;
char noment[30];
char addrent[50];
int codent;
char villent[20];
char phonent[11];
};
 
struct stagiaire
{
int numsta;
char nomsta[30];
char prensta[20];
char addsta[50];
int codsta;
char villsta[20];
char phonsta[11];
int numentrep;
};
 
struct indexsta
{
int numstagiaire;
char nomstagiaire[30];
int numeroentrep;
};
 
struct indexent
{
int numeroent;
char nament[30];
};
 
struct secteur
{
numsect;
nomsect[30];
nomresp[30];
numeentr;
};
 
 
 
void creationentrep (int);
void creationstag (int);
void creationindexstag(int);
void affichent (struct entreprise);
void affichesta (struct stagiaire);
void listent (int,struct entreprise);
void liststagiaire(int,struct stagiaire);
int rechvident (int);
int rechvidsta (int);
void ajoutent(struct entreprise ,int);
void ajoutsta(struct stagiaire ,int,int);
int rechent(char[],int);
int rechsta(char[],int);
void suppent (char[],int);
void suppsta (char[],int);
void misajour_ind_sta (struct indexsta,struct stagiaire);
void modifent (struct entreprise ,int);
void modifsta (struct stagiaire,int);
void creationindexent(int);
void misajour_ind_ent (struct indexent,struct entreprise,int);
void affichindexent (struct indexent);
void affichindexsta (struct indexsta);
void listindexent (int,struct indexent);
void modifcletrang (struct stagiaire,struct entreprise);
void listindexsta (int,struct indexsta);
void creationsecteur (int);
void affichsect (struct secteur);
void listsect (int,struct secteur);
int rechvidsect (int);
void ajoutsect(struct secteur,int,int);
void suppsect (char[],int);
int rechsect(char [],int);
void modifsect (struct secteur,int);
void liststagiaire_entreprises (int,int,struct stagiaire,struct entreprise);
void listsecteur_entreprises (int,int,struct secteur,struct entreprise);
void liststagiairelionel (int,struct stagiaire);
 
 
main()
{
int rep=0,comp,nbmaxent,nbmaxsta,nbmaxsect;
struct entreprise vent,*pent;
struct stagiaire vsta,*psta;
struct indexent vi_ent;
struct secteur vsect;
struct indexsta vi_sta;
char entrep[40]={0},stagi[40]={0},secteur[30],choix;
 
 
     /*//////////*/
/*/////////////////////////////MENU///////////////////////////////*/
     /*//////////*/
 
 
 
textcolor(47);
while (rep!=4)
  {
  clrscr();
  printf ("\n\t\tÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" );
  printf ("\n\t\tº    GESTION D'ENTREPRISE     º" );
  printf ("\n\t\tÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹" );
  printf ("\n\t\tº       MENU PRINCIPAL        º" );
  printf ("\n\t\tÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" );
  printf ("\n\n\n\t1.Travailler sur le fichier entreprise" );
  printf ("\n\t2.Travailler sur le fichier stagiaire" );
  printf ("\n\t3.Travailler sur le fichier secteur\n\t4.Quitter" );
  printf ("\n\nVotre choix: " );
  scanf ("%d",&rep);
  switch (rep)
    {
    case 1:
    printf ("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" );
    printf ("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" );
    printf ("\n\nATTENTION  Toujours s?lectionner l'option 1 avant " );
    printf (" de manipuler le fichier..." );
    getch();
    for (comp=0;rep!=8;comp++)
      {
      rep=0;
      textcolor(47);
      clrscr();
      printf ("\n\tÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" );
      printf ("\n\tº  Travail sur le fichier entreprise  º" );
      printf ("\n\tÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" );
      printf ("\n\n1.Creer le fichier entreprise." );
      printf ("\n2.Lister les fiches entreprises." );
      printf ("\n3.Lister les entreprises ? l'aide de l'index." );
      printf ("\n4.Ajouter une entreprise." );
      printf ("\n5.Supprimer une entreprise." );
      printf ("\n6.Modifier une fiche.\n7.Effectuer la requ?te 1." );
      printf ("\n8.Quitter." );
      printf ("\n\n\n\tVotre choix: " );
      scanf ("%d",&rep);
   switch (rep)
     {
     case 1:clrscr();
     printf("\n\nDe combien de fiches voulez-vous composer le fichier entreprise: " );
     scanf ("%d",&nbmaxent);
     while (nbmaxent<=0)
       {
       printf ("\nEntrez un nombre correct: " );
       scanf ("%d",&nbmaxent);
       }
     while (nbmaxent>9999)
       {
       printf ("\nEntrez un nombre correct: " );
       scanf ("%d",&nbmaxent);
       }
     creationentrep(nbmaxent);
     creationindexent (nbmaxent);break;
     case 2:listent(nbmaxent,vent);break;
     case 3:listindexent(nbmaxent,vi_ent);break;
     case 4:ajoutent(vent,nbmaxent);break;
     case 5:suppent (entrep,nbmaxent);break;
     case 6:modifent (vent,nbmaxent);break;
     case 7:liststagiaire_entreprises (nbmaxent,nbmaxsta,vsta,vent);break;
        }
      }break;
    case 2:
    printf ("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" );
    printf ("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" );
    printf ("\n\nATTENTION  Toujours s?lectionner l'option 1 avant " );
    printf (" de manipuler le fichier..." );
    getch();
 for (comp=0;rep!=8;comp++)
      {
      rep=0;
      textcolor(47);
      clrscr();
      printf ("\n\tÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" );
      printf ("\n\tº  Travail sur le fichier stagiaire   º" );
      printf ("\n\tÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" );
      printf ("\n\n1.Creer le fichier stagiaire." );
      printf ("\n2.Lister les fiches stagiaires." );
      printf ("\n3.Lister les stagiaires ? l'aide de l'index." );
      printf ("\n4.Ajouter un stagiaire." );
      printf ("\n5.Supprimer un stagiaire." );
   printf ("\n6.Modifier une fiche.\n7.Effectuer le requ?te nø4\n8.Quitter." );
      printf ("\n\n\n\tVotre choix: " );
      scanf ("%d",&rep);
   switch (rep)
     {
     case 1:clrscr();
     printf ("\n\nDe combien de fiches voulez-vous composer le fichier stagiaire: " );
     scanf ("%d",&nbmaxsta);
     creationstag(nbmaxsta);
     while (nbmaxsta<=0)
       {
       printf ("\nEntrez un nombre correct: " );
       scanf ("%d",&nbmaxsta);
       }
     while (nbmaxsta>9999)
       {
       printf ("\nEntrez un nombre correct: " );
       scanf ("%d",&nbmaxsta);
       }
     creationindexstag(nbmaxsta);break;
     case 2:liststagiaire(nbmaxsta,vsta);break;
     case 3:listindexsta(nbmaxsta,vi_sta);break;
     case 4:ajoutsta(vsta,nbmaxent,nbmaxsta);break;
     case 5:suppsta (stagi,nbmaxsta);break;
  case 6:modifsta(vsta,nbmaxsta);break;
  case 7:liststagiairelionel (nbmaxsta,vsta);break;
     }
      }break;
    case 3:
    printf ("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" );
    printf ("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" );
    printf ("\n\nATTENTION  Toujours s?lectionner l'option 1 avant " );
    printf (" de manipuler le fichier..." );
    getch();
    for (comp=0;rep!=7;comp++)
      {
      rep=0;
      textcolor(47);
      clrscr();
      printf ("\n\tÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" );
      printf ("\n\tº  Travail sur le fichier secteur  º" );
      printf ("\n\tÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" );
      printf ("\n\n1.Creer le fichier secteur." );
      printf ("\n2.Lister les fiches secteur." );
      printf ("\n3.Ajouter un secteur." );
      printf ("\n4.Supprimer un secteur." );
      printf ("\n5.Modifier une fiche." );
      printf ("\n6.Effectuer la requ?te 2." );
      printf ("\n7.Quitter." );
      printf ("\n\n\n\tVotre choix: " );
      scanf ("%d",&rep);
   switch (rep)
     {
     case 1:clrscr();
     printf("\n\nDe combien de fiches voulez-vous composer le fichier secteur: " );
     scanf ("%d",&nbmaxsect);
     while (nbmaxsect<=0)
       {
       printf ("\nEntrez un nombre correct: " );
       scanf ("%d",&nbmaxsect);
       }
     while (nbmaxsect>9999)
       {
       printf ("\nEntrez un nombre correct: " );
       scanf ("%d",&nbmaxsect);
       }
     creationsecteur(nbmaxsect);
     case 2:listsect(nbmaxsect,vsect);break;
     case 3:ajoutsect(vsect,nbmaxent,nbmaxsect);break;
     case 4:suppsect (secteur,nbmaxsect);break;
     case 5:modifsect (vsect,nbmaxsect);break;
     case 6:listsecteur_entreprises (nbmaxent,nbmaxsect,vsect,vent);
        }
      }break;
    }
  }
}
getch();
 
    /*/////////////*/
/*///////////////////////////FONCTIONS//////////////////////////////*/
    /*/////////////*/
 
/*/////////////////creation du fichier entreprise///////////////////*/
 
void creationentrep (int nbmaxent)
{
FILE *pt;
struct entreprise vent={0,"","",0,"",""};
int i;
char rep;
 
if (pt!=0)
  {
  printf("\nEcraser le fichier existant(o/n): " );
  rep=getche();
  if (rep=='o';)
    {
    printf ("\a" );
    pt=fopen("c:Filent.dat","wb" );
    for (i=1;i<=nbmaxent;i++)
      fwrite(&vent,sizeof(vent),1,pt);
    fclose(pt);
    }
  }
}
 
/*/////////////////creation du fichier secteur//////////////////////*/
 
void creationsecteur (int nbmaxsect)
{
FILE *pt;
struct secteur vsect={0,"","",0};
int i;
char rep;
 
if (pt!=0)
  {
  printf("\nEcraser le fichier existant(o/n): " );
  rep=getche();
  if (rep=='o';)
    {
    printf ("\a" );
    pt=fopen("c:Filsect.dat","wb" );
    for (i=1;i<=nbmaxsect;i++)
      fwrite(&vsect,sizeof(vsect),1,pt);
    fclose(pt);
    }
  }
}
 
/*/////////////////creation du fichier stagiaire/////////////////////*/
 
void creationstag(int nbmaxsta)
{
FILE *pt;
struct stagiaire vsta={0,"","","",0,"","",0};
int i;
char rep;
 
if (pt!=0)
  {
  printf("\nEcraser le fichier existant(o/n): " );
  rep=getche();
  if (rep=='o';)
    {
    printf ("\a" );
    pt=fopen("c:Filsta.dat","wb" );
    for (i=1;i<=nbmaxsta;i++)
      fwrite(&vsta,sizeof(vsta),1,pt);
    fclose(pt);
    }
  }
}
 
/*////////////////////////creation de l'index sta/////////////////////*/
 
void creationindexstag(int nbmaxsta)
{
FILE *pt;
struct indexsta vi_sta={0,"",0};
int i;
 
pt=fopen("c:Fili_sta.dat","wb" );
for (i=1;i<=nbmaxsta;i++)
  fwrite(&vi_sta,sizeof(vi_sta),1,pt);
fclose(pt);
}
 
/*////////////////////////creation de l'index ent//////////////////////*/
 
void creationindexent(int nbmaxent)
{
FILE *pt;
struct indexent vi_ent={0,""};
int i;
 
pt=fopen("c:Fili_ent.dat","wb" );
for (i=1;i<=nbmaxent;i++)
  fwrite(&vi_ent,sizeof(vi_ent),1,pt);
fclose(pt);
}
 
/*//////////////////////afficher entreprise////////////////////////////*/
 
void affichent (struct entreprise vent)
{
printf ("\n\nNø d'entreprise: %d",vent.nument);
printf ("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" );
printf ("\nNom de l'entreprise: %s",vent.noment);
printf ("\nAddresse: %s",vent.addrent);
printf ("\nCode postal: %d",vent.codent);
printf ("\nVille: %s",vent.villent);
printf ("\nT?l?phonne: %s",vent.phonent);
}
 
/*////////////////////////afficher secteur/////////////////////////////*/
 
void affichsect (struct secteur vsect)
{
printf("\n\nNø du stagiaire: %d",vsect.numsect);
printf("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" );
printf("\nNom: %s",vsect.nomsect);
printf("\nNom du responsable: %s",vsect.nomresp);
printf("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" );
printf("\nNø d'entreprise: %d",vsect.numeentr);
}
 
/*///////////////////////afficher stagiaire/////////////////////////////*/
 
void affichsta (struct stagiaire vsta)
{
printf("\n\nNø du stagiaire: %d",vsta.numsta);
printf("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" );
printf("\nNom: %s",vsta.nomsta);
printf("\nPr?nom: %s",vsta.prensta);
printf("\nAdresse: %s",vsta.addsta);
printf("\nCode postal: %d",vsta.codsta);
printf("\nVille: %s",vsta.villsta);
printf("\nT?l?phonne: %s",vsta.phonsta);
printf("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" );
printf("\nNø d'entreprise: %d",vsta.numentrep);
}
 
/*////////////////////afficher index de l'entrep///////////////////////*/
 
void affichindexent (struct indexent vi_ent)
{
printf ("\n\nNø de l'entreprise: %d",vi_ent.numeroent);
printf ("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" );
printf ("\nNom de l'entreprise: %s",vi_ent.nament);
}
 
/*///////////////////afficher index stagiaire//////////////////////////*/
 
void affichindexsta (struct indexsta vi_sta)
{
printf ("\n\nNø de stagiaire: %d",vi_sta.numstagiaire);
printf ("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" );
printf ("\nNom du stagiaire: %s",vi_sta.nomstagiaire);
printf ("\nNø d'entreprise: %d",vi_sta.numeroentrep);
}
 
/*////////////////////////Listage entreprise///////////////////////////*/
 
void listent (int nbmaxent,struct entreprise vent)
{
FILE *pt;
int comp=0;
 
pt=fopen("c:Filent.dat","rb" );
while (comp<=nbmaxent)
  {
  comp++;
  clrscr();
  fread(&vent,sizeof(vent),1,pt);
  if (vent.nument!=0)
    {
    affichent(vent);
    printf ("\n\n/Appuyez sur Enter/" );
    getch();
    }
  }
fclose(pt);
}
 
/*//////////////////listage de l'index entreprise//////////////////////*/
 
void listindexent (int nbmaxent,struct indexent vi_ent)
{
FILE *pt;
int comp=0;
 
pt=fopen("c:Fili_ent.dat","rb" );
while (comp<=nbmaxent)
  {
  comp++;
  clrscr();
  fread(&vi_ent,sizeof(vi_ent),1,pt);
  if (vi_ent.numeroent!=0)
    {
    affichindexent(vi_ent);
    printf ("\n\n/Appuyez sur Enter/" );
    getch();
    }
  }
fclose(pt);
}
 
/*////////////////listage de l'index stagiaire///////////////////////////*/
 
void listindexsta (int nbmaxsta,struct indexsta vi_sta)
{
FILE *pt;
int comp=0;
 
pt=fopen("c:Fili_sta.dat","rb" );
while (comp<=nbmaxsta)
  {
  comp++;
  clrscr();
  fread(&vi_sta,sizeof(vi_sta),1,pt);
  if (vi_sta.numstagiaire!=0)
    {
    affichindexsta(vi_sta);
    printf ("\n\n/Appuyez sur Enter/" );
    getch();
    }
  }
fclose(pt);
}
 
/*/////////////////////listage du fichier secteur////////////////////////*/
 
void listsect (int nbmaxsect,struct secteur vsect)
{
FILE *pt;
int comp=0;
 
pt=fopen("c:Filsect.dat","rb" );
while (comp<=nbmaxsect)
  {
  comp++;
  clrscr();
  fread(&vsect,sizeof(vsect),1,pt);
  if (vsect.numsect!=0)
    {
    affichsect(vsect);
    printf ("\n\n/Appuyez sur Enter/" );
    getch();
    }
  }
fclose(pt);
}
 
/*///////////////////////listage stagiaire//////////////////////////////*/
 
 
void liststagiaire (int nbmaxsta,struct stagiaire vsta)
{
FILE *pt;
int comp=0;
 
pt=fopen("c:Filsta.dat","rb" );
while (comp<=nbmaxsta)
  {
  comp++;
  clrscr();
  fread(&vsta,sizeof(vsta),1,pt);
  if (vsta.numsta!=0)
    {
    affichsta(vsta);
    printf ("\n\n/Appuyez sur Enter/" );
    getch();
    }
  }
fclose(pt);
}
 
/*///////////////////recherche vide entreprise///////////////////////////*/
 
int rechvident (int nbmaxent)
{
FILE *pt;
int i=0,exit=1;
struct entreprise vent;
 
pt=fopen("c:Filent.dat","rb" );
for (i=0;i<nbmaxent+1 && exit>0;i++)
  {
  if (i>nbmaxent)
    {
    printf ("\n\nLe fichier est plein..." );
    getch();
    }
    else
    {
    fread(&vent,sizeof(vent),1,pt);
    if (vent.nument==0)
      exit=-1;
    }
  }
fclose (pt);
return (i);
}
 
/*////////////////////////recherche vide secteur/////////////////////*/
 
int rechvidsect (int nbmaxsect)
{
FILE *pt;
int i=0,exit=1;
struct secteur vsect;
 
pt=fopen("c:Filsect.dat","rb" );
for (i=0;i<nbmaxsect+1 && exit>0;i++)
  {
  if (i>nbmaxsect)
    {
    printf ("\n\nLe fichier est plein..." );
    getch();
    }
    else
    {
    fread(&vsect,sizeof(vsect),1,pt);
    if (vsect.numsect==0)
      exit=-1;
    }
  }
fclose (pt);
return (i);
}
 
 
/*/////////////////////recherche vide stagiaire/////////////////////////*/
 
int rechvidsta (int nbmaxsta)
{
FILE *pt;
int i=0,exit=1;
struct stagiaire vsta;
 
pt=fopen("c:Filsta.dat","rb" );
for (i=0;i<nbmaxsta+1 && exit>0;i++)
  {
  if (i>nbmaxsta)
    {
    printf ("\n\nLe fichier est plein..." );
    getch();
    }
    else
    {
    fread(&vsta,sizeof(vsta),1,pt);
    if (vsta.numsta==0)
      exit=-1;
    }
  }
fclose (pt);
return (i);
}
 
 
/*//////////////////////////ajout entrep//////////////////////////////////*/
 
void ajoutent (struct entreprise vent,int nbmaxent)
{
FILE *pt;
int posi;
struct indexent vi_ent;
 
printf ("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" );
printf ("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" );
printf ("\n\nATTENTION. Les champs obligatoires seront pr?c?d?s de *..." );
getch();
clrscr();
printf ("\n   ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" );
printf ("\n   º Vous allez maintenant remplir une fiche º" );
printf ("\n   ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ " );
pt=fopen("c:Filent.dat","r+b" );
fflush (stdin);
posi=rechvident (nbmaxent);
fseek(pt,(posi-1)*sizeof(vent),0);
vent.nument=posi;
printf ("\n*Entrez le nom: " );
fflush(stdin);
gets (vent.noment);
while (strcmp("",vent.noment)==0)
  {
  if (strcmp("",vent.noment)==0)
    {
    textcolor(-2);
    clrscr();
    textcolor(47);
    printf ("\n\n\aATTENTION. " );
    getch();
    clrscr();
    textcolor(-2);
    printf ("Ce champs est obligatoire" );
    printf ("\n\nR?entrez le nom: " );
    fflush(stdin);
    gets (vent.noment);
    }
  }
fflush(stdin);
printf ("\n*Entrez l'adresse complete: " );
gets (vent.addrent);
while (strcmp("",vent.addrent)==0)
  {
  if (strcmp("",vent.addrent)==0)
    {
    textcolor(-2);
    clrscr();
    textcolor(47);
    printf ("\n\n\aATTENTION. " );
    getch();
    clrscr();
    textcolor(-2);    printf ("Ce champs est obligatoire" );
    printf ("\n\nR?entrez l'adresse compl?te: " );
    fflush(stdin);
    gets (vent.addrent);
    }
  }
fflush(stdin);
printf ("\n*Entrez le code postal: " );
scanf ("%d",&vent.codent);
while (vent.codent<1000)
  {
  clrscr();
  printf ("\nVeuillez entrer un code postal correct" );
  printf ("\n\nR?entrez le code postal: " );
  fflush(stdin);
  scanf ("%d",&vent.codent);
  }
while (vent.codent>9999)
  {
  clrscr();
  printf ("\nVeuillez entrer un code postal correct" );
  printf ("\n\nR?entrez le code postal: " );
  fflush(stdin);
  scanf ("%d",&vent.codent);
  }
while (vent.codent==0)
  {
  if (vent.codent==0)
    {
    textcolor(-2);
    clrscr();
    textcolor(47);
    printf ("\n\n\aATTENTION. " );
    getch();
    clrscr();
    textcolor(-2);
    printf ("Ce champs est obligatoire" );
    printf ("\n\nR?entrez le code postal: " );
    fflush(stdin);
    scanf ("%d",&vent.codent);
    }
  }
fflush(stdin);
printf ("\n*Entrez la ville: " );
gets (vent.villent);
while (strcmp("",vent.villent)==0)
  {
  if (strcmp("",vent.villent)==0)
    {
    textcolor(-2);
    clrscr();
    textcolor(47);
    printf ("\n\n\aATTENTION. " );
    getch();
    clrscr();
    textcolor(-2);
    printf ("Ce champs est obligatoire" );
    printf ("\n\nR?entrez la ville: " );
    fflush(stdin);
    gets (vent.villent);
    }
  }
fflush(stdin);
printf ("\n Entrez le tel: " );
gets (vent.phonent);
fflush(stdin);
misajour_ind_ent (vi_ent,vent,nbmaxent);
fwrite (&vent,sizeof(vent),1,pt);
fclose(pt);
}
 
/*/////////////////////ajout d'une fiche secteur//////////////////////////*/
 
void ajoutsect(struct secteur vsect,int nbmaxent,int nbmaxsect)
{
FILE *pt;
int posi;
 
printf ("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" );
printf ("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" );
printf ("\n\nATTENTION. Les champs obligatoires seront pr?c?d?s de *..." );
getch();
clrscr();
printf ("\n   ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" );
printf ("\n   º Vous allez maintenant remplir une fiche º" );
printf ("\n   ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ " );
pt=fopen("c:Filsect.dat","r+b" );
fflush (stdin);
posi=rechvidsect (nbmaxsect);
fseek(pt,(posi-1)*sizeof(vsect),0);
vsect.numsect=posi;
printf ("\n*Entrez le nom: " );
fflush(stdin);
gets (vsect.nomsect);
while (strcmp("",vsect.nomsect)==0)
  {
  if (strcmp("",vsect.nomsect)==0)
    {
    textcolor(-2);
    clrscr();
    textcolor(47);
    printf ("\n\n\aATTENTION. " );
    getch();
    clrscr();
    textcolor(-2);
    printf ("Ce champs est obligatoire" );
    printf ("\n\nR?entrez le nom: " );
    fflush(stdin);
    gets (vsect.nomsect);
    }
  }
fflush(stdin);
printf ("\n*Entrez le nom du responsable: " );
gets (vsect.nomresp);
while (strcmp("",vsect.nomresp)==0)
  {
  if (strcmp("",vsect.nomresp)==0)
    {
    textcolor(-2);
    clrscr();
    textcolor(47);
    printf ("\n\n\aATTENTION. " );
    getch();
    clrscr();
    textcolor(-2);
    printf ("Ce champs est obligatoire" );
    printf ("\n\nR?entrez le nom: " );
    fflush(stdin);
    gets (vsect.nomresp);
    }
  }
fflush (stdin);
printf ("\n*Entrez le Nød'entreprise: " );
scanf ("%d",&vsect.numeentr);
while (vsect.numeentr<0)
  {
  clrscr();
  printf ("\nCe num?ro d'entreprise est impossible" );
  printf ("\n\nR?entrez le num?ro: " );
  fflush(stdin);
  scanf ("%d",&vsect.numeentr);
  }
while (vsect.numeentr>nbmaxent)
  {
  clrscr();
  printf ("\nCe num?ro d'entreprise est impossible" );
  printf ("\n\nR?entrez le num?ro: " );
  fflush(stdin);
  scanf ("%d",&vsect.numeentr);
  }
while (vsect.numeentr==0)
  {
  if (vsect.numeentr==0)
    {
    textcolor(-2);
    clrscr();
    textcolor(47);
    printf ("\n\n\aATTENTION. " );
    getch();
    clrscr();
    textcolor(-2);
    printf ("Ce champs est obligatoire" );
    printf ("\n\nR?entrez le num?ro: " );
    fflush(stdin);
    scanf ("%d",&vsect.numeentr);
    }
  }
fflush(stdin);
fwrite (&vsect,sizeof(vsect),1,pt);
fclose(pt);
}
 
 
/*/////////////////////ajout d'une fiche stagiaire///////////////////////*/
 
void ajoutsta (struct stagiaire vsta,int nbmaxent,int nbmaxsta)
{
FILE *pt;
int posi;
struct indexsta vi_sta;
 
printf ("\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" );
printf ("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" );
printf ("\n\nATTENTION. Les champs obligatoires seront pr?c?d?s de *..." );
getch();
clrscr();
printf ("\n   ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" );
printf ("\n   º Vous allez maintenant remplir une fiche º" );
printf ("\n   ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ " );
pt=fopen("c:Filsta.dat","r+b" );
fflush (stdin);
posi=rechvidsta (nbmaxsta);
fseek(pt,(posi-1)*sizeof(vsta),0);
vsta.numsta=posi;
printf ("\n*Entrez le nom: " );
fflush(stdin);
gets (vsta.nomsta);
while (strcmp("",vsta.nomsta)==0)
  {
  if (strcmp("",vsta.nomsta)==0)
    {
    clrscr();
    textcolor(-2);
    printf ("\n\n\aATTENTION. " );
    textcolor(47);
    printf ("Ce champs est obligatoire" );
    printf ("\n\nR?entrez le nom: " );
    fflush(stdin);
    gets (vsta.nomsta);
    }
  }
fflush(stdin);
printf ("\n*Entrez le pr?nom: " );
gets (vsta.prensta);
while (strcmp("",vsta.prensta)==0)
  {
  if (strcmp("",vsta.prensta)==0)
    {
    textcolor(-2);
    clrscr();
    textcolor(47);
    printf ("\n\n\aATTENTION. " );
    getch();
    clrscr();
    textcolor(-2);
    printf ("Ce champs est obligatoire" );
    printf ("\n\nR?entrez le pr?nom: " );
    fflush(stdin);
    gets (vsta.prensta);
    }
  }
fflush(stdin);
printf ("\n*Entrez l'adresse complete: " );
gets(vsta.addsta);
while (strcmp("",vsta.addsta)==0)
  {
  if (strcmp("",vsta.addsta)==0)
    {
    textcolor(-2);
    clrscr();
    textcolor(47);
    printf ("\n\n\aATTENTION. " );
    getch();
    clrscr();
    textcolor(-2);
    printf ("Ce champs est obligatoire" );
    printf ("\n\nR?entrez l'adresse compl?te: " );
    fflush (stdin);
    gets(vsta.addsta);
    }
  }
fflush(stdin);
printf ("\n*Entrez le code postal: " );
scanf ("%d",&vsta.codsta);
while (vsta.codsta<1000)
  {
  clrscr();
  printf ("\nVeuillez entrer un code postal correct" );
  printf ("\n\nR?entrez le code postal: " );
  fflush(stdin);
  scanf ("%d",&vsta.codsta);
  }
while (vsta.codsta>9999)
  {
  clrscr();
  printf ("\nVeuillez entrer un code postal correct" );
  printf ("\n\nR?entrez le code postal: " );
  fflush(stdin);
  scanf ("%d",&vsta.codsta);
  }
while (vsta.codsta==0)
  {
  if (vsta.codsta==0)
    {
    textcolor(-2);
    clrscr();
    textcolor(47);
    printf ("\n\n\aATTENTION. " );
    getch();
    clrscr();
    textcolor(-2);
    printf ("Ce champs est obligatoire" );
    printf ("\n\nR?entrez le code postal: " );
    fflush (stdin);
    scanf ("%d",&vsta.codsta);
    }
  }
fflush(stdin);
printf ("\n*Entrez la ville: " );
gets (vsta.villsta);
while (strcmp("",vsta.villsta)==0)
  {
  if (strcmp("",vsta.villsta)==0)
    {
 
    printf ("Ce champs est obligatoire" );
    printf ("\n\nR?entrez la ville: " );
    fflush(stdin);
    gets (vsta.villsta);
    }
  }
fflush(stdin);
printf ("\n Entrez le tel: " );
gets (vsta.phonsta);
fflush(stdin);
printf ("\n*Entrez le Nød'entreprise: " );
scanf ("%d",&vsta.numentrep);
while (vsta.numentrep<0)
  {
  clrscr();
  printf ("\nCe num?ro d'entreprise est impossible" );
  printf ("\n\nR?entrez le code num?ro: " );
  fflush(stdin);
  scanf ("%d",&vsta.numentrep);
  }
while (vsta.numentrep>nbmaxent)
  {
  clrscr();
  printf ("\nCe num?ro d'entreprise est impossible" );
  printf ("\n\nR?entrez le num?ro: " );
  fflush(stdin);
  scanf ("%d",&vsta.numentrep);
  }
while (vsta.numentrep==0)
  {
  if (vsta.numentrep==0)
    {
    textcolor(-2);
    clrscr();
    textcolor(47);
    printf ("\n\n\aATTENTION. " );
    getch();
    clrscr();
    textcolor(-2);
    printf ("Ce champs est obligatoire" );
    printf ("\n\nR?entrez le num?ro: " );
    fflush(stdin);
    scanf ("%d",&vsta.numentrep);
    }
  }
fflush(stdin);
misajour_ind_sta (vi_sta,vsta);
fwrite (&vsta,sizeof(vsta),1,pt);
fclose(pt);
}
 
/*//////////////////suppression d'une fiche entreprise////////////////////*/
 
 
void suppent (char entrep[30],int nbmaxent)
{
FILE *pt;
int i,rep,fich,num,posi;
struct entreprise vent;
struct indexent vi_ent;
struct stagiaire vsta;
char oui,choix;
 
clrscr();
pt=fopen("c:Filent.dat","r+b" );
printf("\nConnaissez vous le Nø ? supprimer(o/n): " );
oui=getche();
if (oui=='o';)
  {
  printf ("\nQuel est le num?ro de la fiche: " );
  scanf ("%d",&fich);
  fseek (pt,(fich-1)*sizeof(vent),0);
  printf ("\n\nVoulez-vous r?ellement supprimer cette entreprise(o/n): " );
  choix=getche();
  if (choix=='o';)
    {
    vent.nument=0;
    misajour_ind_ent (vi_ent,vent,nbmaxent);
    modifcletrang (vsta,vent);
    fwrite (&vent,sizeof(vent),1,pt);
    printf ("\nEntreprise supprim?e..." );
    getch();
    }
  else
    {
    clrscr();
    printf ("\a" );
    printf ("\n\nSUPPRESSION ANNULEE" );
    getch();
    }
  }
  else
  {
  fflush (stdin);
  printf ("\nVeuillez entrer le nom de l'entreprise ? supprimer: " );
  gets(entrep);
  posi=rechent(entrep,nbmaxent);
  fseek (pt,(posi-1)*sizeof(vent),0);
  printf ("\n\nVoulez-vous r?ellement supprimer cette entreprise(o/n): " );
  rep=getche();
  if (rep=='o';)
    {
    vent.nument=0;
    misajour_ind_ent (vi_ent,vent,nbmaxent);
    modifcletrang (vsta,vent);
    fwrite (&vent,sizeof(vent),1,pt);
    printf ("\a" );
    printf ("\nEntreprise supprim?e..." );
    getch();
    }
    else
      printf ("SUPPRESSION ANNULEE" );
  }
fclose(pt);
}
 
/*////////////////////suppression d'un secteur/////////////////////////*/
 
void suppsect (char secteur[30],int nbmaxsect)
{
FILE *pt;
int i,rep,fich,num,posi;
struct entreprise vent;
struct secteur vsect;
char oui,choix;
 
clrscr();
pt=fopen("c:Filsect.dat","r+b" );
printf("\nConnaissez vous le Nø ? supprimer(o/n): " );
oui=getche();
if (oui=='o';)
  {
  printf ("\nQuel est le num?ro de la fiche: " );
  scanf ("%d",&fich);
  fseek (pt,(fich-1)*sizeof(vsect),0);
  printf ("\n\nVoulez-vous r?ellement supprimer ce secteur(o/n): " );
  choix=getche();
  if (choix=='o';)
    {
    vsect.numsect=0;
    fwrite (&vsect,sizeof(vsect),1,pt);
    printf ("\a" );
    printf ("\nSecteur supprim?e..." );
    getch();
    }
  else
    {
    clrscr();
    printf ("\n\nSUPPRESSION ANNULEE" );
    getch();
    }
  }
  else
  {
  fflush (stdin);
  printf ("\nVeuillez entrer le nom du secteur ? supprimer: " );
  gets(secteur);
  posi=rechsect(secteur,nbmaxsect);
  fseek (pt,(posi-1)*sizeof(vsect),0);
  printf ("\n\nVoulez-vous r?ellement supprimer ce secteur(o/n): " );
  rep=getche();
  if (rep=='o';)
    {
    vsect.numsect=0;
    fwrite (&vsect,sizeof(vsect),1,pt);
    printf ("\a" );
    printf ("\Secteur supprim?e..." );
    getch();
    }
    else
      printf ("SUPPRESSION ANNULEE" );
  }
fclose(pt);
}
 
/*////////////////////suppression d'une fiche stagiaire//////////////////*/
 
void suppsta (char stagi[30],int nbmaxsta)
{
FILE *pt;
int i,rep,fich,num,posi;
struct entreprise vent;
struct indexsta vi_sta;
struct stagiaire vsta;
char oui,choix;
 
clrscr();
pt=fopen("c:Filsta.dat","r+b" );
printf("\nConnaissez vous le Nø ? supprimer(o/n): " );
oui=getche();
if (oui=='o';)
  {
  printf ("\nQuel est le num?ro de la fiche: " );
  scanf ("%d",&fich);
  fseek (pt,(fich-1)*sizeof(vent),0);
  printf ("\n\nVoulez-vous r?ellement supprimer ce stagiaire(o/n): " );
  choix=getche();
  if (choix=='o';)
    {
    vsta.numsta=0;
    misajour_ind_sta (vi_sta,vsta);
    modifcletrang (vsta,vent);
    fwrite (&vsta,sizeof(vsta),1,pt);
    printf ("\a" );
    printf ("\nStagiaire supprim?..." );
    getch();
    }
  else
    {
    clrscr();
    printf ("\n\nSUPPRESSION ANNULEE" );
    getch();
    }
  }
  else
  {
  fflush (stdin);
  printf ("\nVeuillez entrer le nom du stagiaire ? supprimer: " );
  gets(stagi);
  posi=rechsta(stagi,nbmaxsta);
  fseek (pt,(posi-1)*sizeof(vsta),0);
  printf ("\n\nVoulez-vous r?ellement supprimer ce stagiaire(o/n): " );
  rep=getche();
  if (rep=='o';)
    {
    vsta.numsta=0;
    misajour_ind_sta (vi_sta,vsta);
    modifcletrang (vsta,vent);
    fwrite (&vsta,sizeof(vsta),1,pt);
    printf ("\a" );
    printf ("\nStagiaire supprim?e..." );
    getch();
    }
    else
      printf ("SUPPRESSION ANNULEE" );
  }
fclose(pt);
}
 
/*////////////////////////recherche d'une entreprise////////////////////*/
 
int rechent(char entrep[30],int nbmaxent)
{
FILE *pt;
int i,ok,numero=0,exit=0;
struct entreprise vent;
 
pt=fopen("c:Filent.dat","rb" );
for(i=0;i<=nbmaxent+1 && exit!=1;i++)
  {
  if (i==nbmaxent+1)
    printf ("\nL'entreprise n'existe pas." );
    getch();
  fread(&vent,sizeof(vent),1,pt);
  ok=strcmp(entrep,vent.noment);
  if (ok==0)
    {
    numero=i+1;
    exit=1;
    }
  }
fclose(pt);
return(numero);
}
 
/*///////////////////////////recherche d'un secteur////////////////////*/
 
int rechsect(char secteur[30],int nbmaxsect)
{
FILE *pt;
int i,ok,numero=0,exit=0;
struct secteur vsect;
 
pt=fopen("c:Filsect.dat","rb" );
for(i=0;i<=nbmaxsect+1 && exit!=1;i++)
  {
  if (i==nbmaxsect+1)
    printf ("\nLe secteur n'existe pas." );
    getch();
  fread(&vsect,sizeof(vsect),1,pt);
  ok=strcmp(secteur,vsect.nomsect);
  if (ok==0)
    {
    numero=i+1;
    exit=1;
    }
  }
fclose(pt);
return(numero);
}
 
/*///////////////////////recherche d'un stagiaire//////////////////////*/
 
int rechsta(char stagi[30],int nbmaxsta)
{
FILE *pt;
int i,ok,numero=0,exit=0;
struct stagiaire vsta;
 
pt=fopen("c:Filsta.dat","rb" );
for(i=0;i<=nbmaxsta+1 && exit!=1;i++)
  {
  if (i==nbmaxsta+1)
    printf ("\nLe stagiaire n'existe pas." );
    getch();
  fread(&vsta,sizeof(vsta),1,pt);
  ok=strcmp(stagi,vsta.nomsta);
  if (ok==0)
    {
    numero=i+1;
    exit=1;
    }
  }
fclose(pt);
return(numero);
}
 
/*///////////////////modification d'un stagiaire///////////////////////*/
 
void modifsta (struct stagiaire vsta,int nbmaxsta)
{
FILE *pt;
char stagi[30],oui,nom[30],addr[60],ville[30],phone[30];
int posi,rep=0,num,fich,numentr,code;
struct indexsta vi_sta;
 
pt=fopen("c:Filsta.dat","rb" );
clrscr();
printf("\nConnaissez vous le Nø ? modifier(o/n): " );
oui=getche();
if (oui=='o';)
  {
  printf ("\nQuel est le num?ro de la fiche: " );
  scanf ("%d",&fich);
  fseek (pt,(fich-1)*sizeof(vsta),0);
  }
  else
  {
  fflush(stdin);
  printf ("\nEntrez le nom du stagiaire ? modifier: " );
  gets(stagi);
  posi=rechsta(stagi,nbmaxsta);
  fseek (pt,posi*sizeof(vsta),0);
  }
  fread (&vsta,sizeof(vsta),1,pt);
  num=vsta.numsta;
  strcpy(nom,vsta.nomsta);
  strcpy(addr,vsta.addsta);
  code=vsta.codsta;
  strcpy(ville,vsta.villsta);
  strcpy(phone,vsta.phonsta);
  numentr=vsta.numentrep;
  fclose(pt);
  while (rep!=7)
    {
    clrscr();
    printf ("\n\t\tMENU DE MODIFICATION" );
    printf ("\n\t\tÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" );
    printf ("\n\n\t1.Nom\n\t2.Adresse\n\t3.Code postal\n\t4.Ville" );
    printf ("\n\t5.T?l?phonne\n\t6.Nøentreprise\n\t7.Quitter" );
    printf ("\n\n\tVotre coix: " );
    scanf("%d",&rep);
    clrscr();
    switch (rep)
      {
      case 1:
      fflush(stdin);
      printf ("\nNom actuel: %s",nom);
      printf ("\nNouveau nom: " );
      gets (nom);
      break;
      case 2:
      fflush(stdin);
      printf ("\nAdresse actuelle: %s",addr);
      printf ("\nNouvelle adresse: " );
      gets (addr);
      break;
      case 3:
      fflush(stdin);
      printf ("\nCode postal actuel: %d",code);
      printf ("\nNouveau code postal: " );
      scanf ("%d",&code);
      break;
      case 4:
      fflush(stdin);
      printf ("\nVille actuelle: %s",ville);
      printf ("\nNouvelle ville: " );
      gets (ville);
      break;
      case 5:
      fflush(stdin);
      printf ("\nNø de t?l?phonne actuel: %s",phone);
      printf ("\nNouveau Nø: " );
      gets(phone);
      break;
      case 6:
      fflush(stdin);
      printf ("\nNøentreprise actuel: %d",numentr);
      printf ("\nNouveau num?ro: " );
      scanf ("%d",&numentr);
      }
   }
pt=fopen("c:Filsta.dat","r+b" );
vsta.numsta=num;
strcpy(vsta.nomsta,nom);
strcpy(vsta.addsta,addr);
vsta.codsta=code;
strcpy(vsta.villsta,ville);
strcpy(vsta.phonsta,phone);
vsta.numentrep=numentr;
misajour_ind_sta (vi_sta,vsta);
fwrite(&vsta,sizeof(vsta),1,pt);
fclose(pt);
}
 
/*//////////////////////modification d'un secteur/////////////////////*/
 
void modifsect (struct secteur vsect,int nbmaxsect)
{
FILE *pt;
char secteur[30],oui,nom[30],nomres[30];
int posi,rep=0,num,fich,numentr;
 
pt=fopen("c:Filsect.dat","rb" );
clrscr();
printf("\nConnaissez vous le Nø ? modifier(o/n): " );
oui=getche();
if (oui=='o';)
  {
  printf ("\nQuel est le num?ro de la fiche: " );
  scanf ("%d",&fich);
  fseek (pt,(fich-1)*sizeof(vsect),0);
  }
  else
  {
  fflush(stdin);
  printf ("\nEntrez le nom du secteur ? modifier: " );
  gets(secteur);
  posi=rechsect(secteur,nbmaxsect);
  fseek (pt,posi*sizeof(vsect),0);
  }
  fread (&vsect,sizeof(vsect),1,pt);
  num=vsect.numsect;
  strcpy(nom,vsect.nomsect);
  strcpy(nomres,vsect.nomresp);
  numentr=vsect.numeentr;
  fclose(pt);
  while (rep!=4)
    {
    clrscr();
    printf ("\n\t\tMENU DE MODIFICATION" );
    printf ("\n\t\tÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" );
    printf ("\n\n\t1.Nom\n\t2.Nom responsable" );
    printf ("\n\t3.Nøentreprise\n\t4.Quitter" );
    printf ("\n\n\tVotre coix: " );
    scanf("%d",&rep);
    clrscr();
    switch (rep)
      {
      case 1:
      fflush(stdin);
      printf ("\nNom actuel: %s",nom);
      printf ("\nNouveau nom: " );
      gets (nom);
      break;
      case 2:
      fflush(stdin);
      printf ("\nNom du responsable actuel: %s",nomres);
      printf ("\nNouveau nom: " );
      gets (nomres);
      break;
      case 3:
      fflush(stdin);
      printf ("\nNøentreprise actuel: %d",numentr);
      printf ("\nNouveau num?ro: " );
      scanf ("%d",&numentr);
      }
   }
pt=fopen("c:Filsta.dat","r+b" );
vsect.numsect=num;
strcpy(vsect.nomsect,nom);
strcpy(vsect.nomresp,nomres);
vsect.numeentr=numentr;
fwrite(&vsect,sizeof(vsect),1,pt);
fclose(pt);
}
 
/*//////////////////modification d'une entreprise//////////////////////*/
 
void modifent (struct entreprise vent,int nbmaxent)
{
FILE *pt;
char entrep[30],oui,nom[30],addr[60],ville[30],phone[30];
int posi,rep=0,num,fich,code;
struct indexent vi_ent;
 
pt=fopen("c:Filent.dat","rb" );
clrscr();
printf("\nConnaissez vous le Nø ? modifier(o/n): " );
oui=getche();
if (oui=='o';)
  {
  printf ("\nQuel est le num?ro de la fiche: " );
  scanf ("%d",&fich);
  fseek (pt,(fich-1)*sizeof(vent),0);
  }
  else
  {
  fflush(stdin);
  printf ("\nEntrez le nom de l'entreprise ? modifier: " );
  gets(entrep);
  posi=rechent(entrep,nbmaxent);
  fseek (pt,posi*sizeof(vent),0);
  }
  fread (&vent,sizeof(vent),1,pt);
  num=vent.nument;
  strcpy(nom,vent.noment);
  strcpy(addr,vent.addrent);
  code=vent.codent;
  strcpy(ville,vent.villent);
  strcpy(phone,vent.phonent);
  fclose(pt);
  while (rep!=6)
    {
    clrscr();
    printf ("\n\t\tMENU DE MODIFICATION" );
    printf ("\n\t\tÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" );
    printf ("\n\n\t1.Nom\n\t2.Adresse\n\t3.Code postal\n\t4.Ville" );
    printf ("\n\t5.T?l?phonne\n\t6.Quitter" );
    printf ("\n\n\tVotre coix: " );
    scanf("%d",&rep);
    clrscr();
    switch (rep)
      {
      case 1:
      fflush(stdin);
      printf ("\nNom actuel: %s",nom);
      printf ("\nNouveau nom: " );
      gets (nom);
      break;
      case 2:
      fflush(stdin);
      printf ("\nAdresse actuelle: %s",addr);
      printf ("\nNouvelle adresse: " );
      gets (addr);
      break;
      case 3:
      fflush(stdin);
      printf ("\nCode postal actuel: %d",code);
      printf ("\nNouveau code postal: " );
      scanf("%d",&code);
      break;
      case 4:
      fflush(stdin);
      printf ("\nVille actuelle: %s",ville);
      printf ("\nNouvelle ville: " );
      gets (ville);
      break;
      case 5:
      fflush(stdin);
      printf ("\nNø de t?l?phonne actuel: %s",phone);
      printf ("\nNouveau Nø: " );
      gets(phone);
      break;
      }
   }
pt=fopen("c:Filent.dat","r+b" );
vent.nument=num;
strcpy(vent.noment,nom);
strcpy(vent.addrent,addr);
vent.codent=code;
strcpy(vent.villent,ville);
strcpy(vent.phonent,phone);
misajour_ind_ent (vi_ent,vent,nbmaxent);
fwrite(&vent,sizeof(vent),1,pt);
fclose(pt);
}
 
 
 
/*///////////////mise ? jour de l'index stagiaire///////////////////////*/
 
void misajour_ind_sta (struct indexsta vi_sta,struct stagiaire vsta)
{
FILE *pt;
 
pt=fopen("c:Fili_sta.dat","r+b" );
vi_sta.numstagiaire=vsta.numsta;
strcpy (vi_sta.nomstagiaire,vsta.nomsta);
vi_sta.numeroentrep=vsta.numentrep;
fwrite(&vi_sta,sizeof(vi_sta),1,pt);
fclose(pt);
}
 
/*/////////////////mise ? jour de l'index entreprise////////////////////*/
 
void misajour_ind_ent (struct indexent vi_ent,struct entreprise vent,int nbmaxent)
{
FILE *pt;
 
pt=fopen("c:Fili_ent.dat","r+b" );
vi_ent.numeroent=vent.nument;
strcpy (vi_ent.nament,vent.noment);
fwrite(&vi_ent,sizeof(vi_ent),1,pt);
fclose(pt);
}
 
/*/////////////////mise ? jour des cl?s ?trangeres///////////////////////*/
 
void modifcletrang (struct stagiaire vsta,struct entreprise vent)
{
FILE *pt;
 
pt=fopen("c:Filsta.dat","r+b" );
vsta.numentrep=vent.nument;
fwrite(&vsta,sizeof(vsta),1,pt);
fclose(pt);
}
 
 
         /*//////////////////////*/
/*//////////////////////////////REQUETES//////////
///////////////////////*/
         /*//////////////////////*/
 
 
 
/*//////////////listage des stagiaires par les entreprises///////////////*/
 
void liststagiaire_entreprises (int nbmaxent,int nbmaxsta,struct stagiaire vsta,struct entreprise vent)
{
FILE *ptr;
FILE *pt;
int comp=0,fich,posi;
char oui,choix,entrep[30];
 
clrscr();
printf ("\n\tÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" );
printf ("\n\tº                          º" );
printf ("\n\tº      REQUETE Nø 1        º" );
printf ("\n\tº                          º" );
printf ("\n\tÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" );
printf ("\n\n     listage des stagiaires par le num?ro de l'entreprise" );
printf ("\n     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
ÄÄ" );
ptr=fopen("c:Filent.dat","rb" );
printf("\n\nConnaissez vous le Num?ro de l'entreprise..." );
printf ("\ndans laquelle vous d?sirez lister les stagiaires(o/n): " );
oui=getche();
if (oui=='o';)
  {
  printf ("\nQuel est le num?ro de la fiche: " );
  scanf ("%d",&fich);
  fseek (pt,(fich-1)*sizeof(vent),0);
 
  }
  else
  {
  fflush (stdin);
  printf ("\n\nVeuillez entrer le nom de l'entreprise: " );
  gets(entrep);
  posi=rechent(entrep,nbmaxent);
  fseek (pt,(posi-1)*sizeof(vent),0);
  fich=posi;
  pt=fopen("c:Filsta.dat","rb" );
  while (comp<=nbmaxsta)
    {
    comp++;
    fread(&vsta,sizeof(vsta),1,pt);
    if (vsta.numentrep==fich)
      {
      clrscr();
      affichsta(vsta);
      printf ("\n\n/Appuyez sur Enter/" );
      getch();
      }
    }
  }
fclose(pt);
fclose(ptr);
}
 
/*//////////////listage des secteurs par les entreprises///////////////*/
 
void listsecteur_entreprises (int nbmaxent,int nbmaxsect,struct secteur vsect,struct entreprise vent)
{
FILE *ptr;
FILE *pt;
int comp=0,fich,posi;
char oui,choix,entrep[30];
 
clrscr();
printf ("\n\tÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" );
printf ("\n\tº                          º" );
printf ("\n\tº      REQUETE Nø 2        º" );
printf ("\n\tº                          º" );
printf ("\n\tÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" );
printf ("\n\n     listage des secteurs par le num?ro de l'entreprise" );
printf ("\n     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
" );
ptr=fopen("c:Filent.dat","rb" );
printf("\n\nConnaissez vous le Num?ro de l'entreprise..." );
printf ("\ndans laquelle vous d?sirez lister les secteurs(o/n): " );
oui=getche();
if (oui=='o';)
  {
  printf ("\nQuel est le num?ro de la fiche: " );
  scanf ("%d",&fich);
  fseek (pt,(fich-1)*sizeof(vent),0);
 
  }
  else
  {
  fflush (stdin);
  printf ("\n\nVeuillez entrer le nom de l'entreprise: " );
  gets(entrep);
  posi=rechent(entrep,nbmaxent);
  fseek (pt,(posi-1)*sizeof(vent),0);
  fich=posi;
  pt=fopen("c:Filsect.dat","rb" );
  while (comp<=nbmaxsect)
    {
    comp++;
    fread(&vsect,sizeof(vsect),1,pt);
    if (vsect.numeentr==fich)
      {
      clrscr();
      affichsect(vsect);
      printf ("\n\n/Appuyez sur Enter/" );
      getch();
      }
    }
  }
fclose(pt);
fclose(ptr);
}
 
/*////////////////////////////////////////////////
////////////////////*/
 
void liststagiairelionel (int nbmaxsta,struct stagiaire vsta)
{
FILE *pt;
int comp=0,fich,posi;
char nom[10]="lionel";
 
clrscr();
printf ("\n\tÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" );
printf ("\n\tº                          º" );
printf ("\n\tº      REQUETE Nø 4        º" );
printf ("\n\tº                          º" );
printf ("\n\tÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" );
printf ("\n\n     listage des stagiaires s'appelant Lionel" );
printf ("\n     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ" );
pt=fopen("c:Filsta.dat","rb" );
while (comp<=nbmaxsta)
  {
  comp++;
  fread(&vsta,sizeof(vsta),1,pt);
  if (strcmp(vsta.prensta,nom)==0)
 {
 clrscr();
 affichsta(vsta);
 printf ("\n\n/Appuyez sur Enter/" );
 getch();
 }
  }
fclose(pt);
}
 
 
 
mon plus gros programme et en plus il est tt buggé :/  :D


---------------
:sol:
Reply

Marsh Posté le 30-03-2002 à 09:41:36    

bistou a écrit a écrit :

 
mon plus gros programme et en plus il est tt buggé :/  :D  




normal, t'as oublié d'écrire print "bonjour"! comment veux-tu qu'un programme fonctionne sans cette ligne???? :D

Reply

Marsh Posté le 30-03-2002 à 09:47:16    

:non:  en c c printf  :D


---------------
:sol:
Reply

Marsh Posté le 30-03-2002 à 09:51:02    

bistou a écrit a écrit :

:non:  en c c printf  :D  




c'est ce que tu crois mais print"bonjour" c'est un code qui permet au chinois du fbi de voir que c'est un programme fait par un particulier et de valider son utilisation. sinon ils considère que c'est un programme ps2 pour controler des missiles nucléaires et ils le buggent exprès :D

Reply

Marsh Posté le 30-03-2002 à 09:51:35    

CrowFix a écrit a écrit :

 
c'est ce que tu crois mais print"bonjour" c'est un code qui permet au chinois du fbi de voir que c'est un programme fait par un particulier et de valider son utilisation. sinon ils considère que c'est un programme ps2 pour controler des missiles nucléaires et ils le buggent exprès :D  




 
[:totoz]


---------------
:sol:
Reply

Marsh Posté le 01-04-2002 à 23:17:24    

Modifiez les graphs de ce super ( :D ) jeu. le meilleur aura le droit de voir son avatar dans mon prochain jeu de la mort

Reply

Marsh Posté le    

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed