int main(){int m = 0;int n = 0;scanf("%d %d", &m, &n);int sum = 0;int i = 0;int k = 0;for (i = 0; i < n; i++){k = k * 10 + m;sum = sum + k;}printf("%d", sum);return 0;} 我们这里不考虑过大的数字,否则会越界; m代表几个数,
代码如下 #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 * 100