填空题 C++
题号 #2656959

以下程序中实现两个数的交换,请将程序补充完整。
 #include<iostream>
using namespace std;
voiD.main( )
{
    int a=5,b=9;
    voiD.swap(int *, int *);
    swap(__1__  );
    cout<<"a="<<a<<"b="<<b<<endl;
}
voiD.swap(int *p, int *q)
{
    __2__;  
    t=*p; *p=*q; *q=t;
}

进入在线模考

参考答案

暂无

答案解析

1:&a,&b  2:int t;  或  int t

你可能感兴趣的试题

找试题 · 找答案 · 找资料 在线模考