Accepted
代码
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
int Sum(int a, int n)
{
assert(n > 0);
int sum = 0;
int temp = a;
for (int i = 0; i < n; i++)
{
sum = sum + a;
a = (a * 10) + temp;
}
return sum;
}
int main()
{
int a = 0;
int n = 0;
scanf("%d", &a);
scanf("%d", &n);
printf("%d\n", Sum(a, n));
system("pause");
return 0;
}