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