C语言习题 编写一程序 在屏幕上显示一菜单 并根据用户的选择执行相应的功能

2024-11-16 06:39:42
推荐回答(1个)
回答(1):

#include"stdio.h"

int main()
{
    do{
   int num;
    printf("主菜单项:\n1-预览添加\n2-查找修改\n3-删除\n0-退出系统\n");
    printf("请选择操作:");
    scanf("%d",&num);
   
        switch (m)
        {
            case 1:
                printf("***信息预览添加***\n");
                break;
            case 2:
                printf("***信息查找修改***\n");
                break;
            case 3:
                printf("***信 息 删 除***\n");
                break;
            case 0:
                printf("***退 出 系 统***\n");
                
                exit(0);
            default:
                break;
        }
   
        
    
    }while(num!=0);
    return 0;
}