diff --git a/23a.cpp b/23a.cpp new file mode 100644 index 0000000..3b2a649 --- /dev/null +++ b/23a.cpp @@ -0,0 +1,17 @@ +#include +using namespace std; +int main(){ + int * ptr_a, * ptr_b,temp; + ptr_a = new int; + ptr_b = new int; + cout<<"请输入*ptr_a的值:"; + cin>>*ptr_a; + cout<<"请输入*ptr_b的值:"; + cin>>*ptr_b; + temp=*ptr_a; + *ptr_a=*ptr_b; + *ptr_b=temp; + cout<<*ptr_a<<" "<<*ptr_b<