Je vous proposse ce menu et j'espere que vous avez d'autre idée ou d'autre menu à nous presenter
/**** MENU ****/
void menu()
{int selec=0;char rep;
clrscr();
affichage();//getch();
_setcursortype(_NOCURSOR);
do{
if(selec==0)
{
textcolor(13);
textbackground(15);
gotoxy(35,12);
cprintf("1 OPERATOR +");
}
else
{
textcolor(6);
textbackground(0);
gotoxy(35,12);
cprintf("1 OPERATOR +");
}
if(selec==1)
{
textcolor(13);
textbackground(15);
gotoxy(35,13);
cprintf("2 OPERATOR -");
}
else
{
textcolor(6);
textbackground(0);
gotoxy(35,13);
cprintf("2 OPERATOR -");
}
if(selec==2)
{
textcolor(13);
textbackground(15);
gotoxy(35,14);
cprintf("3 OPERATOR *");
}
else
{
textcolor(6);
textbackground(0);
gotoxy(35,14);
cprintf("3 OPERATOR *");
}
if(selec==3)
{
textcolor(13);
textbackground(15);
gotoxy(35,15);
cprintf("4 OPERATOR /");
}
else
{
textcolor(6);
textbackground(0);
gotoxy(35,15);
cprintf("4 OPERATOR /");
}
if(selec==4)
{
textcolor(13);
textbackground(15);
gotoxy(35,15);
cprintf("5 QUITTER");
}
else
{
textcolor(6);
textbackground(0);
gotoxy(35,15);
cprintf("5 QUITTER");
}
switch(rep=getch()){
case '8':{selec--;break;}
case '2':{selec++;break;}
case 'O' :{if(selec==0)
operator+();
if(selec==1)
operator-();
if(selec==2)
operator*();
if(selec==3)
operator/();
if(selec==4)
rep='v';break;}
}
if(selec<0)
selec=4;
else
if(selec>4)
selec=0;
}
while(rep!='v');}
Partager