自己的eclipse可以运行,慕课不可以
来源:3-9 编程练习
慕码人4259003
2019-04-01 15:45:51
package proj;
import java.util.Scanner;
public class CharDemo {
public static void main(String[] args) {
System.out.println("请输入:");
Scanner sc=new Scanner(System.in);
char ch= sc.next().charAt(0);
switch(ch) {
case 'a':
System.out.println("是元音字母");break;
case 'o':
System.out.println("是元音字母");break;
case 'e':
System.out.println("是元音字母");break;
case 'u':
System.out.println("是元音字母");break;
default:
System.out.println("不是元音字母");
}
}
}
1回答
同学你好,程序正确,在慕课上可能由于网速等原因造成无法运行,建议同学在自己的环境中运行一下。如果我的回答解决了你的疑惑,请采纳。祝:学习愉快~
相似问题