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。应该是编译环境有问题。你百度下

    评论

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料