注意:此页面搜索的是所有试题
题目内容
(许昌学院面向对象程序设计)
[改错题,10分]
8题目:函数fun的功能是:实现交换两个整数的值。例如给a和b 分别输入3和6 ,输出为a=6 b=3
程序中共有 条错误语句。
void fun (int a, b)
{
int t;
t=a;
a=b;
b=t;
}
main()
{
int a,b;
cout<<"enter a,b:");
cin>>a>>b;
fun(&a,&b);
cout<<><>< p=""> <a<<b;
}
8题目:函数fun的功能是:实现交换两个整数的值。例如给a和b 分别输入3和6 ,输出为a=6 b=3
程序中共有 条错误语句。
void fun (int a, b)
{
int t;
t=a;
a=b;
b=t;
}
main()
{
int a,b;
cout<<"enter a,b:");
cin>>a>>b;
fun(&a,&b);
cout<<><>< p=""> <a<<b;
}
参考答案

