0
0
已采纳
0
0
0
0
0
int x; //相当于题中的n
long long s=1; //用来存阶乘结果
cin>>x; //读入x,就是题中n
for (int i=2; i<=x; i++) { //循环遍历从2到n的数,再相乘
s*=i;
}
cout<<s<<endl; //输出结果
0
0
