en fait voila mon prog ms il couille
#include <stdio.h>
#include <conio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#define MAX 30
#define XMIN 0
#define XMAX 100
#define JMIN 0
#define JMAX 100
#define YMAX 100
/////////////////////////////////////////////////////////////////////////////////
////////////////Gestion de la base de données d'une bibliothèque/////////////////
/////////////////////////////////////////////////////////////////////////////////
typedef char tab_char2 [YMAX][JMAX];
typedef char tab_char [YMAX][XMAX];
tab_char2 tab2;
tab_char tab1;
void echange(tab_char &tab1, int i,int j);
void tri(tab_char &tab1,int i,int j);
void ajouter(tab_char &tab1, int nblivre);
void stock(tab_char &tab1, int nblivre);
void depart(tab_char &tab1, tab_char2 &tab2, int nblivre, int livre);
void retour(tab_char &tab1, tab_char2 &tab2, int nblivre, int livre);
void quitter();
int i,x,y,ddep,dret,dretmax,ox,oy,nom,prenom,nomlivre,curs;
int nblivre,livre, j;
int boucle=1;
int ymin,ymax;
main()
{
while(boucle==1)
{
clrscr();
curs=0;
///////////////////////////cadre ext haut bas////////////////////////////
for (x=2;x<80;x++)
{
gotoxy(x,1);
printf("%c",205);
gotoxy(x,25);
printf("%c",205);
}
////////////////////////cadre ext droite gauche//////////////////////////
for (y=2;y<25;y++)
{
gotoxy(1,y);
printf("%c",186);
gotoxy(80,y);
printf("%c",186);
}
//////////////////////////////coins/////////////////////////////////////
gotoxy(1,1);
printf("%c",201);
gotoxy(80,1);
printf("%c",187);
gotoxy(1,25);
printf("%c",200);
gotoxy(80,25);
printf("%c",188);
/////////////////////////Affichage titre+deplacement///////////////////
for (x=3;x<16;x++)
{
gotoxy(x,5);
printf("Gestion de la Base de Donnees d'une Bibliotheque");
ox=x-1;
gotoxy(ox,5);
printf(" ");
for(i=0;i<3000000;i++)
{
printf("");
}
}
//::::::::::::::::::::cadre titre::::::::::::::::::::::::::::::::::://
///////////////////////////cadre gauche////////////////////////////
gotoxy(14,4);
printf("%c",201);
gotoxy(14,5);
printf("%c",186);
gotoxy(14,6);
printf("%c",200);
//////////////////////////////cadre haut+bas////////////////////////
for (x=15;x<63;x++)
{
gotoxy(x,4);
printf("%c",205);
gotoxy(x,6);
printf("%c",205);
for(i=0;i<2000000;i++)
{
printf("");
}
}
///////////////////////////cadre droite/////////////////////////////////
gotoxy(63,4);
printf("%c",187);
gotoxy(63,5);
printf("%c",186);
gotoxy(63,6);
printf("%c",188);
////////////affichage+deplacement editeurs/////////////////////////////
for(x=3;x<57;x++)
{
gotoxy (x,22);
printf("Edited by. B@rB0uCH XD\n");
gotoxy (x,23);
printf("And by. Marabou xp");
ox=x-1;
gotoxy(ox,22);
printf(" ");
gotoxy(ox,23);
printf(" ");
for(i=0;i<1000000;i++)
{
printf("");
}
}
gotoxy(54,25);
printf("%c", 202);
//////////////////////////cadre editeurs/////////////////////////////
for(y=24;y>20;y--)
{
gotoxy(54,y);
printf("%c",186);
gotoxy(54,20);
printf("%c",201);
}
for(x=55;x<80;x++)
{
gotoxy(x,20);
printf("%c",205);
gotoxy(80,20);
printf("%c",185);
}
////////////////////////////affichage menu///////////////////////////
gotoxy(19,8);
printf("%c",254);
while(curs!=13)
{
gotoxy(21,8);
printf("ajouter %c la bibliotheque", 133);
gotoxy(21,10);
printf("enregistrer un depart");
gotoxy(21,12);
printf("enregistrer un retour");
gotoxy(21,14);
printf("rechercher un livre");
gotoxy(21,16);
printf("quitter");
///////////////////////////////////////////////////////////////////////////
/////////////////fonction deplacement curseur sur menu/////////////////////
///////////////////////////////////////////////////////////////////////////
curs=getch();
if(curs=='P')
{
gotoxy(x,y);
printf(" ");
y=y+2;
gotoxy(x,y);
printf("%c",254);
}
if(curs=='H')
{
gotoxy(x,y);
printf(" ");
y=y-2;
gotoxy(x,y);
printf("%c",254);
}
if(y>ymax)
{
gotoxy(x,y);
printf(" ");
y=ymin;
gotoxy(x,y);
printf("%c",254);
}
if(y<ymin)
{
gotoxy(x,y);
printf(" ");
y=ymax;
gotoxy(x,y);
printf("%c",254);
}
//////////////////entree et affichage menu ajouter/////////////////////
if ((curs==13)&&(y==8))
{
ajouter(&tab1, nblivre);
}
else
if ((curs==13)&&(y==10))
{
depart(&tab1, &tab2, nblivre, livre);
getch();
}
else
if ((curs==13)&&(y==12))
{
retour(&tab1, &tab2, nblivre, livre);
getch();
}
else
if ((curs==13)&&(y==14))
{
stock(&tab1, nblivre);
getch();
}
else
if ((curs==13)&&(y==16))
{
quitter();
boucle=0;
}
}
}
////////////////////////////////////////////////////////////////////////
/////////////////////fonction : champs menu ajouter/////////////////////
////////////////////////////////////////////////////////////////////////
void ajouter(tab_char &tab1, int nblivre);
{
int i=0;
clrscr;
while(nblivre!=100 && i==0)
{
nblivre=nblivre+1;
printf("entrer le nom du livre : ");
scanf("%s", &tab1[1][nblivre]);
printf("entrer le nom de l'auteur : ");
scanf("%s", &tab1[2][nblivre]);
printf("entrer le nom de l'edition : ");
scanf("%s", &tab1[3][nblivre]);
printf("pour ajouter encore->0");
scanf("%i",&i);
clrscr();
}
}
///////////////////////////////////////////////////////////////////////////
///////////////////////////////fonction : stock////////////////////////////
///////////////////////////////////////////////////////////////////////////
void stock(tab_char &tab1, int nblivre);
{
int i;
tri(&tab1, i, j);
for(i=XMIN; i<=nblivre; i++)
{
printf("%f\n",i);
printf("%s",tab1[1][i]);
printf("%s",tab1[2][i]);
printf("%s",tab1[3][i]);
}
}
///////////////////////////////////////////////////////////////////////////
/////////////////////////fonction : tri////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
void tri(tab_char &tab1,int i,int j);
{
for(i=XMIN+1; i<nblivre; i++)
{
j=i-1;
if(tab1[1][i]<tab1[1][j])
echange(tab1, i, j);
}
}
///////////////////////////////////////////////////////////////////////////
////////////////////////fonction : echange/////////////////////////////////
///////////////////////////////////////////////////////////////////////////
void echange(tab_char &tab1, int i,int j);
{
char tmp1, tmp2, tmp3;
tmp1 = tab1[1][i];
tab1[1][i] = tab1[1][j];
tab1[1][j] = tmp1;
tmp2 = tab1[2][i];
tab1[2][i] = tab1[2][j];
tab1[2][j] = tmp2;
tmp3 = tab1[3][i];
tab1[3][i] = tab1[3][j];
tab1[3][j] = tmp3;
}
///////////////////////////////////////////////////////////////////////////
///////////////////fonction : champs menu depart///////////////////////////
///////////////////////////////////////////////////////////////////////////
void depart(tab_char &tab1, tab_char2 &tab2, int nblivre, int livre);
{
clrscr;
int k=0, indice=0;
while((nblivre!=0) && (k==0))
{
livre=livre+1;
nblivre=nblivre-1;
stock(&tab1, nblivre);
printf("quel num de livre vous voulez louer");
scanf("%f", indice);
tab2[1][livre]=tab1[1][indice];
tab2[2][livre]=tab1[2][indice];
tab2[3][livre]=tab1[3][indice];
gotoxy(21,8);
printf("Nom locataire");
scanf("%s", &tab2[5][livre]);
gotoxy(21,18);
printf("date depart");
scanf("%s", &tab2[6][livre]);
gotoxy(21,20);
printf("date retour maximum");
scanf("%s", &tab2[7][livre]);
nblivre=nblivre-1;
getch();
printf("pour sup encor->0");
scanf("%i",&k);
}
}
///////////////////////////////////////////////////////////////////////////
/////////////////////////////fonction : retour/////////////////////////////
///////////////////////////////////////////////////////////////////////////
void retour(tab_char &tab1, tab_char2 &tab2, int nblivre, int livre);
{
clrscr;
int k=0, indice;
while((nblivre!=0) && (k==0))
{
nblivre=nblivre+1;
livre=livre-1;
stock(tab1, nblivre);
printf("quel num de livre vous avez loue");
scanf("%i",&indice);
tab1[1][indice]=tab2[1][livre];
tab1[2][indice]=tab2[2][livre];
tab1[3][indice]=tab2[3][livre];
printf("pour retourner encor->0");
scanf("%i",&k);
}
}
///////////////////////////////////////////////////////////////////////////
//////////////////////////////fonction quitter/////////////////////////////
///////////////////////////////////////////////////////////////////////////
void quitter();
{
clrscr;
gotoxy(10,10);
printf("^^Au revoir et a bientot sur notre systeme de gestion^^\n");
gotoxy(8,12);
printf("B@rbouche et Marabou vous souhaites une bonne critique mdr");
for (i=0; i<120000000; i++)
{
printf("");
}
}
clrscr();
}