#include<iostream>
#include<stdlib.h>
using?namespace?std;
void?change(int?&a,int?&b);
int?main(void){
????int?x?=?10;
????int?y?=?20;
????cout?<<?x?<<?","<<?y?<<endl;
????change(x,y);
????cout?<<?x?<<?","?<<?y?<<endl;
????system("pause");
????return?0;
}
void?change(int?&a,int?&b){
????int?c?=?0;
????c?=?a;
????a?=?b;
????b?=?c;
}為什么在main函數(shù)上面還要將函數(shù)這樣寫一下,不然就報(bào)錯(cuò)
- 0 回答
- 0 關(guān)注
- 1249 瀏覽
添加回答
舉報(bào)
0/150
提交
取消