上传了实验二,已确认无敏感信息

This commit is contained in:
2024-06-10 16:33:43 +08:00
parent 729de600bd
commit f1190f2c2f
6 changed files with 104 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import java.util.Scanner;
public class task1 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
double score = input.nextDouble();
if (score >= 90 & score <= 100) {
System.out.println(4.0);
} else if (score >= 80 & score < 90) {
System.out.println(3.5);
} else if (score >= 70 && score < 80) {
System.out.println(3.0);
} else if (score >= 60 && score < 70) {
System.out.println(2.5);
} else {
System.out.println(0d);
}
}
}
+13
View File
@@ -0,0 +1,13 @@
import java.util.Scanner;
public class task2 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int goal = input.nextInt();
int mutied = 1;
for (int i = 1; i <= goal; i++) {
mutied *= i;
}
System.out.println(mutied);
}
}
+32
View File
@@ -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+"星成绩");
}
}
+13
View File
@@ -0,0 +1,13 @@
public class task4 {
public static void main(String[] args) {
int time = 0;
for (int i = 1; i <= 100; i++) {
if (i % 6 == 0) {
System.out.print(i + " ");
time += 1;
}
}
System.out.println();
System.out.println(time);
}
}
+17
View File
@@ -0,0 +1,17 @@
public class task5 {
public static void main(String[] args) {
for (int i = 1; i <= 10; i++) {
for (int j = 1; j <= i; j++) {
System.out.print("*");
}
System.out.println();
}
System.out.println("-----------------我是华丽的分割线-----------------");
for (int i = 10; i >= 1; i--) {
for (int j = 1; j <= i; j++) {
System.out.print("*");
}
System.out.println();
}
}
}
+10
View File
@@ -0,0 +1,10 @@
public class task6 {
public static void main(String[] args) {
for (int i = 1; i <= 9; i++) {
for (int j = 1; j <= i; j++) {
System.out.print(i + "*" + j + "=" + i * j + "\t");
}
System.out.println();
}
}
}