546trt • 4天前
using namespace std;
int main () {
int n = 0, g = 1, a, k, b = 0; cin >> k; for (int a = 1; a <= k; a++) { g = 1; for (int i = 1; i <= a; i++) { g = g * i; } b = g + b; } cout << b; return 0;
}
评论:
请先登录,才能进行评论