标签:span exti 训练 stat color style com auto margin
--------------------------------------------------------------------------------------------------------------------------------------
本题很简单主要考察的是对int long类型的限制问题
--------------------------------------------------------------------------------------------------------------------------------------
算法
import java.util.Scanner; public class Main { public static void main(String[] args) { int n = new Scanner(System.in).nextInt(); System.out.println((long)n*(n+1)/2); } }
--------------------------------------------------------------------------------------------------------------------------------------
int 长度限制是10位
long 长度限制是19位
标签:span exti 训练 stat color style com auto margin
原文地址:http://www.cnblogs.com/loveluking/p/6034245.html