switch语句

#define _USE_MATH_DEFINES
#include <stdio.h>
#include <math.h>
#include<stdbool.h>
int main() {
    int level=1;//楼层 整型
    switch(){
        case 1:  //必须唯一
            printf("到达第一层。\n");
            break;//可选
        case 2:
            printf("到达第二层\n");
            break;
        default:
        printf("无法到达楼层");
    }
    return 0;
}

 

posted @ 2025-03-27 16:57  华腾智算  阅读(5)  评论(0)    收藏  举报
https://damo.alibaba.com/ https://tianchi.aliyun.com/course?spm=5176.21206777.J_3941670930.5.87dc17c9BZNvLL