C语言编程 简单的main menu

来源:百度知道 编辑:UC知道 时间:2024/05/24 03:32:43
Your program must display an interactive menu containing 6 options. An example of what
your menu would look like is displayed below.
Main Menu:
1) Age calculator
2) Insert a string
3) Converting Roman numerals
4) Magic square
5) Pascal triangle
6) Session Summary
7) Exit
Select your option:
Your program must allow the user to select these options by typing the number and hitting
enter. Upon completion of all options except Exit, the user is returned to the main menu.

就是说用C语言编写一个menu。运行后可以得到上面的图,然后要可以输入数字1-7或者exit

小弟是个初学者希望有能力的帮小弟一把!!谢谢了~~

#include<stdio.h>
void main()
{
int a;
printf("Your program must display an interactive menu containing 6 options. An example of what your menu would look like is displayed below. \nMain Menu:\n");
printf("1) Age calculator\n");
printf("2) Insert a string\n");
printf("3) Converting Roman numerals\n");
printf("4) Magic square\n");
printf("5) Pascal triangle\n");
printf("6) Session Summary\n");
printf("7) Exit\n");
printf("Select your option:\nYour program must allow the user to select these options by typing the number and hitting enter. Upon completion of all options except Exit, the user is returned to the main menu.\n");
scanf("%d",&a);
switch(a)
{
case 1:printf("1) Age calculator\n");
break;<