输入两个正整数a和n,输出a+aa+aaa+…+aaa…aaa
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int n = sc.nextInt();
int num = 0;
int sum = 0;
String str = "";
if (a > 0) {
for (int i = 0; i < n; i++) {
num = num * 10 + a;
if (i < n-1) {
str = str + num + "+";
} else {
str = str + num;
}
sum = sum + num;
}
System.out.println(str + "=" + sum);
}
}
}