用switch语句实现下列菜单功能(c语言)感谢大神

2021-06-27 教育 378阅读
#include
main()
{
    int n=0;
    printf("*************************************\n");
    printf("*             1---成绩输入           *\n");
    printf("*             2---成绩插入           *\n");
    printf("*             3---成绩查询           *\n");
    printf("*             4---成绩排序           *\n");
    printf("*             5---成绩删除           *\n");
    printf("*             6---成绩输出           *\n");
    printf("*             0---退出               *\n");
    printf("*************************************\n");
    printf("请输入你的选择(0---6)");
    scanf("%d",&n);
    switch(n)
    {
        case 1:
                    printf("成绩输入\n");
                    /*此处添加相应的功能*/
                    break;
        case 2:
                    printf("成绩插入\n");
                    /*此处添加相应的功能*/
                    break;
        case 3:
                    printf("成绩查询\n");
                    /*此处添加相应的功能*/
                    break;
        case 4:
                    printf("成绩排序");
                    /*此处添加相应的功能*/
                    break;
        case 5:
                    printf("成绩删除\n");
                    /*此处添加相应的功能*/
                    break;
        case 6:
                    printf("成绩输出\n");
                    /*此处添加相应的功能*/
                    break;
        case 0:  
                    break; 
        default:
                    printf("error:Command not found");
                    break;
    }
}
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com