把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
+18 -18
View File
@@ -1,19 +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);
}
}
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 -13
View File
@@ -1,13 +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);
}
}
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 -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+"星成绩");
}
}
+12 -12
View File
@@ -1,13 +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);
}
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 -17
View File
@@ -1,17 +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();
}
}
}
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 -10
View File
@@ -1,10 +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();
}
}
}
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();
}
}
}