From 8633a4877fdd31973765aa499e6561baf19de20b Mon Sep 17 00:00:00 2001 From: hehe Date: Sat, 14 Mar 2026 05:31:23 -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 --- 260314/两数交换指针.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 260314/两数交换指针.cpp diff --git a/260314/两数交换指针.cpp b/260314/两数交换指针.cpp new file mode 100644 index 0000000..b4fea1a --- /dev/null +++ b/260314/两数交换指针.cpp @@ -0,0 +1,20 @@ +#include + +using namespace std; + +int main(){ + int * ptr_a,* ptr_b; + ptr_a = new int; + ptr_b = new int; + int temp; + + cin>>*ptr_a>>*ptr_b; + temp=*ptr_a; + *ptr_a=*ptr_b; + *ptr_b=temp; + cout<<*ptr_a<<" "<<*ptr_b<