题解 | #数列求和#
数列求和
https://www.nowcoder.com/practice/6893484c04c24bfca1f606b1823a468d
public class Main { public static void main(String[] args) { long ret=0; long num=0; for(int i=0;i<=9;i++) { ret=ret*10+9;//每次对ret的处理 num+=ret; } System.out.println(num); } }