qq_37469456 2017-04-29 12:57 采纳率: 7.1%
浏览 929

java小程序老是提示出错

import java.util.*;
public class Test {

public static void main(String[] args) {                          //此行有错!
   int score;
   Scanner scanner=new Scanner(System.in);

   System.out.println("请问您的成绩是多少?(0-100)");
   score=scanner.nextInt();

   if ((score>100) || (score<0))
       System.out.println("输入错误!");
       else if(score>=90)
           System.out.println("您的成绩是优");
           else if(score>=80)
               System.out.println("您的成绩是良!");
           else if(score>=60)
               System.out.println("您的成绩是及格!");
           else
               System.out.println("您的成绩是不及格,必须补考!");


}

}

错误:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
String cannot be resolved to a type
Scanner cannot be resolved to a type
Scanner cannot be resolved to a type
System cannot be resolved to a variable
System cannot be resolved
System cannot be resolved
System cannot be resolved
System cannot be resolved
System cannot be resolved
System cannot be resolved

at Test.main(Test.java:4)
  • 写回答

6条回答 默认 最新

  • hongyu83916 2017-04-29 13:26
    关注

    程序没问题,Unresolved compilation problems。应该是编译环境有问题。你百度下

    评论

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘