1.输入两个数,对其进行交换 #include<iostream> #include<string.h> using namespace std; void swap(int *p1,int *p2){ int t ; t = *p1; *p1 = *p2; *p2 = t; } int main(){ int a,b; cin>>a>>b; swap(a,b); cout<<a<<" "<<b; return 0; }