问答详情
源自:5-3 编程练习优化

为啥写和视频写的一样,但是运行之后中文全变成乱码了啊?是设置有问题吗?

public static void main(String[] args) {
    System.out.print("请输入您的初始成绩:");
    int score = new Scanner(System.in).nextInt();
    int count = 0;
    System.out.println("加分前成绩:"+score);
    while (score<60){
        score++;
        count++;
    }
    System.out.println("加分后成绩:"+score);
    System.out.println("共加了"+count+"次!");
}


提问者:weixin_慕丝1154391 2022-07-27 01:24

个回答

  • weixin_慕尼黑8503832
    2022-09-23 03:38:03

    IDEA里面要设置UTF-8