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