代码如下
#include <stdio.h>
int main()
{
int a, b, c, d, e, f;
printf("请输入一个1-9的数:");
scanf("%d", &a);
b = a * 10 + a; //分别求出十位百位千位万位
c = a * 100 + b;
d = a * 1000 + c;
e = a * 10000 + d;
f = a + b + c + d + e ;
printf("Sn=%d", f);
return 0;
}