From aeaa1396af2dfb2bf38fcd132be8600c3fa13e55 Mon Sep 17 00:00:00 2001 From: haoxuan Date: Sat, 28 Mar 2026 05:42:39 -0400 Subject: [PATCH] =?UTF-8?q?=E9=95=87=E4=B9=83=E5=A4=A9=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 20260314/25a.cpp | 23 +++++++++++++++++++++++ 20260314/25b.cpp | 16 ++++++++++++++++ 20260314/25c.cpp | 21 +++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 20260314/25a.cpp create mode 100644 20260314/25b.cpp create mode 100644 20260314/25c.cpp diff --git a/20260314/25a.cpp b/20260314/25a.cpp new file mode 100644 index 0000000..b751564 --- /dev/null +++ b/20260314/25a.cpp @@ -0,0 +1,23 @@ +#include +using namespace std; +int a[100],n; +int add(int x,int y){ + int z=x+y; + cout<>n; + for(int i=1;i<=n;i++){ + cin>>a[i]; + } + int z,ans=0; + for(int i=1;i<=n;i++){ + z=add(ans,a[i]); + ans=ans+z; + } + cout< +using namespace std; +void w(int a,int b){ + if(a>b) + cout<>a>>b; + w(a,b); + return 0; +} diff --git a/20260314/25c.cpp b/20260314/25c.cpp new file mode 100644 index 0000000..15a8a28 --- /dev/null +++ b/20260314/25c.cpp @@ -0,0 +1,21 @@ +#include +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<