16 lines
250 B
C++
16 lines
250 B
C++
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
|
|
int main() {
|
|
int s = 0;
|
|
// 1!+2!+3!+4!+5!
|
|
int f = 1;
|
|
for (int i = 1; i <= 5; i++) {
|
|
f *= i; // 阶乘
|
|
s += f;
|
|
}
|
|
|
|
cout << s << endl;
|
|
return 0;
|
|
} |