[蓝桥杯] 序列求和 入门

原题

import java.util.Scanner;//导入Scanner类

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextInt();
        sc.close();
        System.out.print((n+1)*n/2);
    }
}
原文地址:https://www.cnblogs.com/ruoh3kou/p/9948770.html