更多"有以下程序:
void swap 1(int c[])
{in"的相关试题:
[简答题]请编写函数void swap(int *px,int *py)与void swap(int &px,int &PY),实现主程序中变量a和b值的交换。
输出结果如下:
3 2
2 3
注意:部分源程序已存在文件test5_2.cpp中。
请勿修改主函数main和其他函数中的任何内容,仅在函数相应的花括号中填写若干语句。
文件test5_2.cpp的内容如下:
#include<iostream.h>
void swap(int *px,int *py)
/***1***/
void swap(int &px,int &PY)
/***2**/
void main( )
int a=2,b=3;
swap(a,b);
cout<<a<<" "<<b<<endl;
swap(&a,&b);
cout<<a<<" "<<b<<endl;
[填空题]以下程序运行后的输出结果是 【13】 。
void swap(int x,int y)
int t;
t=x;x=Y;Y=t;printf("%d%d",x,y);
main( )
int a=3,b=4;
swap(a,b);printf("%d%d",a,b);
[填空题]以下程序运行后的输出结果是【 】。
void swap(int x,int y)
{ int t;
t=x;x=y;y=t;printf("%d%d",x,y);
}
main( )
{ int a=3,b=4;
swap(a,b);pintf(("%d%d",a,b);
}
[多项选择]简单应用题
请编写函数void swap(int *px,int *py) 与void swap(int &px,int &py),实现主程序中变量a和b值的交换。
输出结果如下:
3 2
2 3
注意:部分源程序已存在文件test5_2.cpp中。
请勿修改主函数main和其他函数中的任何内容,仅在函数相应的花括号中填写若干语句。
文件test5_2.cpp的内容如下:
#include
void swap(int *px,int *py)
{
/***1***/
}
void swap(int &px,int &py)
{
/***2***/
}
void main( )
{
int a=2,b=3;
swap(a,b);
cout<
[填空题]以下程序运行后的输出结果是______。
void swap(int X,int y)
int t;
t=x;x=y;y=t;printf("%d%d",x,y);
main( )
int a=3,b=4;
swap(a,b);printf("%d%d/n",a,b);
[填空题]以下程序运行后输出的结果是______。
void swap(int x,int y)
int t;
t=x;x=y;y=t;printf("%d %d”,x,y);
void main( )
int a=3,b=4;
swap(a,b); printf("%d %d",a,b);
[填空题]以下程序运行后的输出结果是______。
void swap(int x,int y)
int t;
t=x;x=y;y=t; printf("%d %d ",x,y);
main( )
int a=3,b=4;
swap(a,b); printf("%d %d/n",a,b);
[填空题]以下程序运行后输出结果是______。
void swap(int x, int y)
int t;
t=x; x=y; y=t; printf("%d %d ",x,y");
main( )
int a=3,b=4;
swap(a,b); printf("%d %d/n",a,b);
[填空题]以下程序运行后的输出结果是______。
void swap(int x,int y)
int t;
t=x;x=y;y=t;printf("%d%d",x,y);main( )
int a=3,b=4;
swap(a,b); printf("%d%d/n",a,b);