代码示例如下:
#include<stdio.h>
int main()
{
int a,n,b,s;
int i;
i=1,b=0;
s=0;
scanf("%d%d",&a,&n);
while(i<=n)
{
i++;
b=b*10+a;
s=s+b;
}
printf("s = %d",s);
return 0;
}
代码示例如下:
#include<stdio.h>
int main()
{
int a,n,b,s;
int i;
i=1,b=0;
s=0;
scanf("%d%d",&a,&n);
while(i<=n)
{
i++;
b=b*10+a;
s=s+b;
}
printf("s = %d",s);
return 0;
}