#define _CRT_SECURE_NO_WARNINGS 1 #include <stdio.h> int main( ) { int i = 1; int num = 1; int x = 0; int sum = 0; for (x = 1; x <= 10; x++) { num = 1; for(i = 1;i<=x;i++) { num = num * i; } sum += num; } printf("for循环,1-10阶乘的和是%d", sum); return 0; }
标签:include,语言,int,代码,练习,main From: https://www.cnblogs.com/ayue6/p/17740943.html