From 9fdfe16b588913c6cf49c241609cb7c8e2eea179 Mon Sep 17 00:00:00 2001 From: hehe Date: Sat, 7 Mar 2026 05:16:06 -0500 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 --- 666/交换.cpp | 13 +++++++++++++ 666/交换2.cpp | 13 +++++++++++++ 666/交换3.cpp | 18 ++++++++++++++++++ 666/最大值2.cpp | 24 ++++++++++++++++++++++++ 666/最大值3.cpp | 17 +++++++++++++++++ 5 files changed, 85 insertions(+) create mode 100644 666/交换.cpp create mode 100644 666/交换2.cpp create mode 100644 666/交换3.cpp create mode 100644 666/最大值2.cpp create mode 100644 666/最大值3.cpp diff --git a/666/交换.cpp b/666/交换.cpp new file mode 100644 index 0000000..e2ade56 --- /dev/null +++ b/666/交换.cpp @@ -0,0 +1,13 @@ +#include +using namespace std; +int main(){ + + int a,b,c; + cin>>a>>b; + cout< +using namespace std; +int main(){ + + int a,b,c; + cin>>a>>b; + cout< +using namespace std; +int main(){ + + int a=25,b=32,tmp; + int *ptr_a, *ptr_b; + + ptr_a=&a; + ptr_b=&b; + + cout<<*ptr_a<<" "<<*ptr_b<<" "; + cout< +using namespace std; +int main(){ + int a[5]={87,99,3,12,1}; + int max=a[0]; + int * ptr_x; + ptr_x=a; + + + for(int i=1;i<5;i++){ + + if(*ptr_x > max){ + max = *ptr_x; + } + ptr_x++; + cout< +using namespace std; +int main(){ + int a[5]={9,99,999,9999,99999}; + int *ptr_x; + int max; + ptr_x=a; + max=*ptr_x; + for(int i=1;i<=5;i++){ + if(*ptr_x>max) + max=*ptr_x; + ptr_x++; +} + cout<