扫码下载编程狮APP
import java.util.stream.LongStream; public class Main { public static void main(String...args){ long l = LongStream.rangeClosed(1, 200).reduce(Long::sum).getAsLong(); System.out.println(l); } }
运行结果如下:
联系方式:
扫描二维码
下载编程狮App
扫码关注 领资料包