程序如下:
#include<stdio.h>
#include<string.h>
intMENU_Print(ints32QuerNum)
{
switch(s32QuerNum)
{
case1:
printf(\"您选择的题目如下:\")
printf(\"1、以下可以正确表示标识符的是:()\")
printf(\"A、Data,Double\")
printf(\"B、case,Big\")
printf(\"C、2011A,hi_ok\")
printf(\"D、_2011,year-month-data\")
break
case2:
printf(\"您选择的题目如下:\")
printf(\"2、以下运算符优先级最低的是:()\")
printf(\"A、?:\")
printf(\"B、++\")
printf(\"C、&&\")
printf(\"D、+=\")
break
case3:
printf(\"您选择的题目如下:\")
printf(\"2、以下选项中不能正确赋值的是:()\")
printf(\"A、chars[20]s=\"ABCDE\"\")
printf(\"B、chars[]=\"ABCDE\"\")
printf(\"C、chars[20]={\"ABCDE\"}\")
printf(\"D、chars[20]={'A','B','C'}\")
break
default:
break
}
return0
}
intmain()
{
ints32ChooseNum=0
while(1)
{
printf(\"题号范围为1-3,请输入题号:\")
scanf(\"%d
#include "stdio.h"#include "stdlib.h"
#include "dos.h"
#include "windows.h"
char choice1
void main()
{
void menue1()
printf("欢迎进入Ben的作业查询系统!")
menue1()
}
void menue1()
{
void choicemenue1()
printf("\n请按照以下列表选择您想要查看的章节:")
printf("\n编号\t章节\n 1\t第一章\n 2\t第二章\n")
printf("请输入编号进行选择:")
choicemenue1()
}
void choicemenue1()
{
choice1=getch()
switch(choice1)
{
void menuechapter1()
void menuechapter2()
void menue1()
case '1':menuechapter1()break
case '2':menuechapter2()break
default:printf("\n输入错误!请重新选择!\n"),menue1()
}}
void menuechapter1()
{
char choiceex
printf("\n您选择的是第%c章",choice1)
printf("\n现在请选择本章节的题目。")
printf("\n请按照以下列表选择题目:")
printf("\n编号\t题目编号\n1\t第1题\n2\t第2题\n")
printf("请选择:")
switch(choiceex=getch())
{
void c1_1()
void c1_2()
case '1':c1_1()break
case '2':c1_2()break
default:
printf("\n你个白痴!这也能选错!不让你重选了!")
printf("\n按任意键以退出!")
getch()
exit(0)
}
}
void menuechapter2()
{
char choiceex
printf("\n您选择的是第%c章",choice1)
printf("\n现在请选择本章节的题目。")
printf("\n请按照以下列表选择题目:")
printf("\n编号\t题目编号\n1\t第1题\n2\t第2题\n")
printf("\n请选择:")
switch(choiceex=getch())
{
void c2_1()
void c2_2()
case '1':c2_1()break
case '2':c2_2()break
default:
printf("\n你个白痴!这也能选错!不让你重选了!")
printf("\n按任意键以退出!")
getch()
exit(0)
}
}
void c1_1()
{
char howtorun
printf("现在请选择考察方式:")
printf("\n编号\t考察方式\n 1\t运行程序\n 2\t查看源代码\n 3\t返回主菜单\n 4\t退出程序\n")
printf("请选择:")
switch(howtorun=getch())
{
void runc1_1()
void menue1()
case '1':runc1_1()break
case '2':printf("\n"),system("type \\caidan\\chapter1\\c1_1.c"),printf("\n"),getch()break
case '3':menue1()break
case '4':exit(0)break
default:
printf("程序即将结束!哈哈哈……")
printf("按任意键以结束程序!")
getch()
exit(0)
}}
void c1_2()
{
printf("c1_2 is OK!")
}void c2_1()
{
printf("c2_1 is OK!")
}void c2_2()
{
printf("c2_2 is OK!")
}
void runc1_1()
{
int a,b,max
printf("\nPlease input two integer numbers:")
printf("a=?,b=?\n")
scanf("%d,%d",&a,&b)
max=a>b?a:b
printf("The max number is %d",max)
}
大概就是这样做的。。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)