style:fmt

This commit is contained in:
dichgrem
2025-11-15 13:30:17 +08:00
parent c20e8949a5
commit 41e6b71bd7
33 changed files with 549 additions and 543 deletions

View File

@@ -1,28 +1,29 @@
package com.study.demo3;
import java.util.*;
public class StudentManager {
public static void main(String[] args) {
List<String> studentNames = new ArrayList<>();
Map<String, Integer> studentScores = new HashMap<>();
public static void main(String[] args) {
List<String> studentNames = new ArrayList<>();
Map<String, Integer> studentScores = new HashMap<>();
studentNames.add("张三");
studentNames.add("李四");
studentNames.add("王五");
studentNames.add("张三");
studentNames.add("李四");
studentNames.add("王五");
studentScores.put("张三", 85);
studentScores.put("李四", 77);
studentScores.put("王五", 99);
studentScores.put("张三", 85);
studentScores.put("李四", 77);
studentScores.put("王五", 99);
System.out.println("--- 所有学生姓名 ---");
for (String name : studentNames) {
System.out.println(name);
}
studentScores.put("张三", 70);
Integer zhangsanScore = studentScores.get("张三");
System.out.println("\n--- 修改后张三的成绩 ---");
System.out.println("张三的成绩: " + zhangsanScore);
System.out.println("--- 所有学生姓名 ---");
for (String name : studentNames) {
System.out.println(name);
}
studentScores.put("张三", 70);
Integer zhangsanScore = studentScores.get("张三");
System.out.println("\n--- 修改后张三的成绩 ---");
System.out.println("张三的成绩: " + zhangsanScore);
}
}