参考代码:
import java.util.Scanner;
public class Main1135 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int n = sc.nextInt();
long y = 0, S = 0;
for (int i = 1; i <= n; i++) {
y = y * 10 + a;
S += y;
}
System.out.println(S);
}
}
0.0分
0 人评分