题解 | #数列求和#
数列求和
https://www.nowcoder.com/practice/6893484c04c24bfca1f606b1823a468d
public class Main { public static void main(String[] args) { //write your code here........ long sum=getNum(); System.out.println(sum); } public static long getNum() { long x=0; long num=0; for(int i=0;i<10;i++) { x+=(long) (9*Math.pow(10,i)); num+=x; //System.out.println(i+" "+x); } return num; } }