mirror of
https://github.com/renbaoshuo/202401-programming-assignments.git
synced 2024-11-23 15:48:42 +00:00
22 lines
284 B
C
22 lines
284 B
C
#include <stdio.h>
|
|
|
|
int main() {
|
|
int a, n, sum = 0;
|
|
|
|
scanf("%d%d", &a, &n);
|
|
|
|
for (int i = 1; i <= n; i++) {
|
|
int x = 0;
|
|
|
|
for (int j = 0; j < i; j++) {
|
|
x = x * 10 + a;
|
|
}
|
|
|
|
sum += x;
|
|
}
|
|
|
|
printf("%d\n", sum);
|
|
|
|
return 0;
|
|
}
|