麻烦老师帮忙看看有什么问题

来源:3-9 编程练习

慕数据8428094

2019-12-16 22:46:15

public class CharDemo {

    public static void main(String[] args) {

//定义一个字符变量并初始化

char ch='a';

//使用switch结构判断是否为元音字母,并输出对应的信息

switch(ch){

    case 'a':System.out.println("元音字母"+ch);break;

    case 'e':System.out.println("元音字母"+ch);break;

    case 'i':System.out.println("元音字母"+ch);break;

    case 'o':System.out.println("元音字母"+ch);break;

    case 'u':System.out.println("元音字母"+ch);break;

    default:

        System.out.println("不是元音字母:");

}

}

}


写回答

1回答

好帮手慕小脸

2019-12-17

同学你好,编程实现的没有问题哦。代码写的很规范,继续加油!
如果我的回答解决了你的疑惑,请采纳,祝学习愉快~

0

0 学习 · 11489 问题

查看课程