习题:求1 ~ n以内所有偶数的和,在main方法中调用该方法。 import java.util.Scanner; public class Text { public static void sum(int n) { int s = 0; fo