上传了实验二,已确认无敏感信息
This commit is contained in:
Executable
+32
@@ -0,0 +1,32 @@
|
||||
import java.util.Scanner;
|
||||
|
||||
public class task3 {
|
||||
public static void main(String[] args) {
|
||||
Scanner input = new Scanner(System.in);
|
||||
System.out.println("星级成绩评定系统");
|
||||
System.out.print("请输入成绩:");
|
||||
double score = input.nextDouble();
|
||||
int stars = 0;
|
||||
String starHanzi;
|
||||
if (score > 90) {
|
||||
stars = 5;
|
||||
starHanzi = "五";
|
||||
} else if (score > 80 & score <= 90) {
|
||||
stars = 4;
|
||||
starHanzi = "四";
|
||||
} else if (score > 70 & score <= 80) {
|
||||
stars = 3;
|
||||
starHanzi = "三";
|
||||
} else if (score >= 60 & score <= 70) {
|
||||
stars = 2;
|
||||
starHanzi = "俩";
|
||||
} else {
|
||||
stars=0;
|
||||
starHanzi="无";
|
||||
}
|
||||
for(int i=1;i<=stars;i++){
|
||||
System.out.print("*");
|
||||
}
|
||||
System.out.println(starHanzi+"星成绩");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user