下面程序的运行结果为( )。#include<iostream.h> voidswap(int&a,intb) { inttemp; temp=a++; a=b: b=temp: } voidmain() { inta=2,b=3; swap(a,b); cout<<a<<","<<b<<endl; }
A.2,3
B.3,2
C.2,2
D.3,3
第1题:
下面程序的运行结果为( )。 #include<iostream.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.; eout<<a<<”,”<<b<<endl; }
A.2,3
B.3,2
C.2,2
D.3,3
第2题:
下面程序的运行结果为( )。 #include<iostream> using namespace std; 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
第3题:
下面程序的运行结果是____。 注意:数据之间用空格隔开 void swap(int a, int b) { int temp; temp=a; a=b; b=temp; } int main() { int i=3,j=5; if(i<j) swap(i,j); cout<<i<<" "<<j<<endl; return 0; }
第4题:
下面程序的运行结果为 #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,3
B.3,2
C.2,2
D.3,3
第5题:
下面程序的运行结果为( )。#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,3
B.3,2
C.2,2
D.3,3