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<