c语言编写菜单程序

来源:百度知道 编辑:UC知道 时间:2024/05/09 03:24:35
由用户输入8个整数,放在立方体的8个顶点上。立方体上的每个面上的4个数构成的集合是否相等,如果相等,就认为立方体成立,否则,输入的8个数不成立,(您可以判断奇数偶数)
希望哪位好心人能帮帮我.

#include<stdio.h>
#include<graphics.h>
#include<conio.h>
void main()
{
char str;
int i,k,choice=1;
int gd=DETECT,gm;
initgraph(&gd,&gm," ");
setbkcolor(2);
settextstyle(3,0,3);
outtextxy(140,120,"A. The Mock Clock.");
outtextxy(140,150,"B. The Digital Clock.");
outtextxy(140,180,"C. Exit.");
setlinestyle(0,0,3);
rectangle(170,115,370,145);

/*按上下键选择所需选项*/
for(i=1;i<=100;i++)
{
str=getch();
if(str==72)
{
--choice;
if(choice==0)choice=3;
}
if(str==80)
{
++choice;
if(choice==4)choice=1;
}

if(str==13)break; /*按回车键确认*/

/*画图做菜单*/

cleardevice();
switch(choice)
{ case 1: setlinestyle(0,0,3);
rectangle(170,115,400,145);

settextstyle(3,0,3);
outtextxy(140,120,"A. The Mock Clock.&qu