原题
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