题解 | #数列求和#
数列求和
https://www.nowcoder.com/practice/6893484c04c24bfca1f606b1823a468d
public class Main { public static void main(String[] args) { //write your code here........ long sum = 0; for (long i = 9; i <= 9999999999l;){ sum += i; i = i * 10 + 9; } System.out.print(sum); } }