把test.java救回来了

This commit is contained in:
2024-06-11 01:53:01 +08:00
parent d085000064
commit d753356d40
54 changed files with 1309 additions and 1297 deletions
+32 -32
View File
@@ -1,32 +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+"星成绩");
}
}
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+"星成绩");
}
}