网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
下面程序的运行结果为 include void swap(int &a, int b) { int temp; temp=a

下面程序的运行结果为

#include<iostream.h>

void swap(int &a, int b)

{

int temp;

temp=a++;

a=b;

b=temp;

}

void main( )

int a=2,b=3;

swap(a, b) ;

cout < < a < <"," < < b < < endl;

}

A.2,3

B.3,2

C.2,2

D.3,3


参考答案

更多 “ 下面程序的运行结果为 include void swap(int a, int b) { int temp; temp=a 下面程序的运行结果为#include<iostream.h>void swap(int a, int b){int temp;temp=a++;a=b;b=temp;}void main( )int a=2,b=3;swap(a, b) ;cout < < a < <"," < < b < < endl;}A.2,3B.3,2C.2,2D.3,3 ” 相关考题
考题 下列程序的运行结果是()。includevoid fun (int *a,int*b){int*kk=a;a=b;b=k}void 下列程序的运行结果是( )。 #include< iostream.h> void fun (int *a,int*b) {int*k k=a;a=b;b=k} void main() {int a=2004, b=9,*x=a,*y=b; fun(x, y) ; cout<<a<<" "<<b<<endl:}A.20049B.92004C.0D.编译时出错

考题 下面程序的运行结果是 include void fun(int * a,int * b) { int x= * a; * a= * 下面程序的运行结果是#include<iostream.h>void fun(int * a,int * b){int x= * a;* a= * b; * b=X;cout < < * a < < * b < <" ";}void main( ){int x=1,y=2;fun(x,y) ;cout < < X < < y < < endl;}A.12 12B.12 21C.21 12D.21 21

考题 下面程序的运行结果为()。includevoid swap(int a,int B) {int temp;temp=a++; 下面程序的运行结果为( )。 #include<iostream.h> void swap(int a,int B) { int temp; temp=a++; a=b; b=temp; } void main() { int a=2,b=3; swap(a,b); cout<<a<<“,”<<b<<end1; }A.2,3B.3,2C.2,2D.3,3

考题 下面程序的运行结果为( )。#includeiostream.h voidswap(int&a,intb) { inttemp; temp=a++; a=b: b=temp: } voidmain() { inta=2,b=3; swap(a,b); couta","bendl; }A.2,3B.3,2C.2,2D.3,3

考题 下面程序输出的结果是( )。 include using namespace std; void swap(int 下面程序输出的结果是( )。 #include <iostream> using namespace std; void swap(int a,int b){ int temp; temp=a; a=b; b=temp; } void main(){ int x=2; int y=3; swap(x,y); cout<<x<<y; }A.23B.32C.abD.ba

考题 下面程序的运行结果为( )。#includeiostream.hvoidswap(int&a,intb){int temp;temp=a++;a=b:b=temp:}voidmain(){inta=2,b=3;swap(a,b);couta,bendl;}A.2,3B.3,2C.2,2D.3,3A.2,3B..3,2C.2,2D.3,3

考题 下面程序的运行结果为( )。 #includeiostream.h void swap(int&a,int B. int temp; temp=a++: a=b: b=temp; } void main { im a=2,b=3; swap(a,B.; eouta”,”bendl; }A.2,3B.3,2C.2,2D.3,3

考题 下面程序的运行结果为()。includevoid swap (int a, int b){int temp;temp=a++ 下面程序的运行结果为( )。#include<iostream.h>void swap (int a, int b){int temp;temp=a++;a=b;b=temp;}void main(){int a=2, b=3;swap(a,b);cout<<a<<","<<b<<end1;}A.2,3B.3,2C.2,2D.3,3

考题 可以交换两个数的函数定义为: void swap(int *p,int *q) { int *temp; *temp=*p; *p=*q; *q=*temp; }