净 WPM0
WPM0
准确率100%
已用时间0s
时间—
字符数0
错误字符0
错误数0
进度0%
阅读代码练习指南
编程语言
Java
难度
中等

Traverse a list and calculate its total.

import java.util.List;

public class Main {
    public static void main(String[] args) {
        List<Integer> values = List.of(4, 8, 15, 16);
        int total = 0;

        for (int value : values) {
            total += value;
        }

        System.out.println(total);
    }
}