镇乃天子
This commit is contained in:
21
20260314/25c.cpp
Normal file
21
20260314/25c.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
|
||||
int x(int n){
|
||||
|
||||
int y=1;
|
||||
for(int i=1;i<=n;i++)
|
||||
y=y*i;
|
||||
return y;
|
||||
|
||||
}
|
||||
|
||||
int main(){
|
||||
int a,b=1;
|
||||
cout<<"请输入一个整数:";
|
||||
cin>>a;
|
||||
|
||||
b=x(a);
|
||||
cout<<b<<endl;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user