public class lianxi08 {
public static void main(String[] args) {
long a , b = 0, sum = 0;
Scanner s = new Scanner(System.in);
System.out.print("输入数字a的值: ");
a = s.nextInt();
System.out.print("输入相加的项数:");
int n = s.nextInt();
int i=0;int b=0;
for(i=0;i<n;i++){
b=b+a*Math.pow(10,i);//10的i次方
sum=sum+b;
}
System.out.println(sum);
}
}