#include<bits/stdc++.h> using namespace std; void swap(int *a,int *b){ int temp = *a; *a = *b; *b = temp; } int main(){ int a=1,b=2; swap(&a,&b); cout<<a<<" "<<b; return 0; }
看看是不是那个分号搞错了,是不是用成中文的分号了