摘要:
#include <iostream> #include <cmath> using namespace std; double f(double x,double n){ if(n==1){ return x/(1+x); } return x/(n+f(x,n-1)); } int main() 阅读全文
posted @ 2024-06-22 09:53
最后一个还有我
阅读(35)
评论(0)
推荐(0)
摘要:
#include <iostream> using namespace std; int s(int n){ int x=1; if(n==1){ return 1; }else{ for(int i=1;i<=n;i++){ x*=i; } } return x+s(n-1); } int mai 阅读全文
posted @ 2024-06-22 08:33
最后一个还有我
阅读(11)
评论(0)
推荐(0)
摘要:
#include <iostream> using namespace std; int s(int n){ if(n<=2){ return n; } return n*s(n-1); } int main(){ int n; cin>>n; cout<<s(n); return 0; } 阅读全文
posted @ 2024-06-22 08:19
最后一个还有我
阅读(11)
评论(0)
推荐(0)

浙公网安备 33010602011771号