1 #include <iostream>
 2 
 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */
 4 using namespace std;
 5 int main(int argc, char** argv) {
 6     void swap(int &,int &);
 7     int i=3,j=5;
 8     swap(i,j);
 9     cout<<"i="<<i<<" "<<"j="<<j<<endl;
10     return 0;
11 }
12 
13 void swap(int &a,int &b)
14 {
15     int temp;
16     temp=a;
17     a=b;
18     b=temp;
19 }

 

相关文章:

  • 2022-12-23
  • 2021-06-11
  • 2022-12-23
  • 2022-12-23
  • 2021-09-09
  • 2022-01-03
  • 2022-12-23
  • 2021-06-30
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-05
  • 2022-12-23
  • 2021-11-08
相关资源
相似解决方案