¸ø¶¨Ò»¸ö°Ù·ÖÖƵķÖÊý£¬Êä³öÏàÓ¦µÄµÈ¼¶¡£
90·ÖÒÔÉÏ A¼¶
80~89 B¼¶
70~79 C¼¶
60~69 D¼¶
60·ÖÒÔÏ E¼¶
import java.util.Scanner;
class Mark{
public static void main(String[] args){
System.out.println(¡°ÇëÊäÈëÒ»¸ö·ÖÊý¡±);
//¶¨ÒåÊäÈëµÄ·ÖÊýΪ¡°mark¡±£¬ÇÒ·ÖÊý»áÓÐСÊý
double mark;
Scanner scanner = new Scanner(System.in);
mark = scanner.nextDouble();
//ÅжÏÊÇ·ñÓÐÊäÈë´íÎó¡£
if(mark<0||mark>100){
System.out.println(¡°ÊäÈëÓÐÎó£¡ ¡°);
System.exit(0);
}
/*ÅжϷÖÊýµÄµÈ¼¶
90·ÖÒÔÉÏÕßA¼¶£¬ 80~89·ÖÕß B¼¶£¬70~79·ÖÕß C¼¶£¬ 60~69Õß D¼¶£¬60·ÖÒÔÏ E¼¶ */
if (mark>=90) System.out.println(¡°this mark is grade \¡¯A\¡¯ ¡°);
else if (mark>=80) System.out.println(¡°this mark is grade \¡¯B\¡¯ ¡°);
else if (mark>=70) System.out.println(¡°this mark is grade \¡¯C\¡¯ ¡°);
else if (mark>=60) System.out.println(¡°this mark is grade \¡¯D\¡¯ ¡°);
else System.out.println(¡°this mark is grade \¡¯E\¡¯ ¡°);
}
}