n+nn+nnn+...+n...=n... 浅浅的花香味﹌ 2022-04-05 09:18 248阅读 0赞 \#include <stdio.h> int main() \{ int input; int i = 0,j; int num; int result = 0; int n; printf("请输入:"); scanf("%d",&n); for(j = 1;j<=n;j++) \{ input = j; num = input; for(i = 0; i < input; i++) \{ printf("%d", num); result+=num; num = num\*10+input; if(i+1 < input) \{ printf("+"); \} \} printf("=%d\\n",result); \} return 0; \}
还没有评论,来说两句吧...