啊哈磊_编程从这里起步

标题: 求救求救 这个怎么做 [打印本页]

作者: 15623280186    时间: 2020-3-9 22:18
标题: 求救求救 这个怎么做
[code]#include <stdio.h>

int main(void)
{
int x=1,y=0;
switch(x)
{
    case 1:
    switch(y)
    {
        case 0:printf("x=1 y=0");break;
        case 1:printf("y=1");break;
        }
case 2:printf("x=2");
}

作者: 也有    时间: 2020-3-10 20:37
#include <stdio.h>

int main()
{
int x=1,y=0;
switch(x)
{
    case 1:
            {
                    switch(y)
                    {
                        case 0:
                                        printf("x=1 y=0");break;
                        case 1:
                                        printf("y=1");break;
                    }
                    break;
                }            
        case 2:
                printf("x=2");
}
return 0;
}//没啥问题吧





欢迎光临 啊哈磊_编程从这里起步 (https://bbs.codeaha.com/) Powered by Discuz! X3.2