public class Demo{ public static void main(String[] args){ long sum=0,a=8,item=a,n=12,i=1; for(i=1;i<=n;i++){ sum = sum +item; item = item*10+a; } System.out.println(sum); } }
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/13125.html
public class Demo{ public static void main(String[] args){ long sum=0,a=8,item=a,n=12,i=1; for(i=1;i<=n;i++){ sum = sum +item; item = item*10+a; } System.out.println(sum); } }
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/13125.html