下面程序的运行结果为include<iostream,h>Void swap(int &a,int b){int temp;temp=a++;a=b;
下面程序的运行结果为 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
时间:2023-10-07 12:56:40
相似题目
-
下面程序的运行结果为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<iostream.h>class A{int num;public:A(int) {num=i;}A(A & a) {hum=a. num++;}void print() {cout < < num;}};void main(){A a(1) ,b(a) ;a. print() ;b. print() ;}
A.11
B.12
C.21
D.22
-
下面程序的运行结果是include<iostream.h>void main(){int num=1;int &ref=num;ref=ref+2;c
下面程序的运行结果是 include<iostream.h> void main() { int num=1; int &ref=num; ref=ref+2; cout<<num; num=num+3; cout<<ref<<end1; }
A.13
B.16
C.36
D.33
-
下列程序的运行结果为()。include<iostream.h>void main(){int a=2;int b=a+1;cout<<a/b<<endl;}
下列程序的运行结果为()。 include<iostream.h> void main() { int a=2; int b=a+1; cout<<a/b<<endl; }
A.0.66667
B.0
C.0.7
D.0.66666666…
-
下列程序的运行结果为 include<iostream.h>void print(double a){cout<<++a;} void print(int a
下列程序的运行结果为 include<iostream.h> void print(double a) { cout<<++a; } void print(int a,int b) { cout<<b<<a; } Void main() { print(1.2); cout<<" "; print(3,4); }
A.1.2 34
B.2.2 34
C.1.2 43
D.2.2 43
-
下面程序的运行结果为#include<iostream.h>void main( )char a='3';switch(
A.
 
-
下面程序的运行结果是()。 include<iostream.h
A.12 12
B.12 21
C.21 12
D.21 21
-
下面程序的运行结果为()。 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
-
下面程序的运行结果是include"iostream.h"define sum(a,b)a*bvoid main(){int x;X=sum(1+2,3);
下面程序的运行结果是 include"iostream.h" define sum(a,b)a*b void main() {int x; X=sum(1+2,3); cout<<x; }
A.0
B.9
C.7
D.5
-
下面程序的运行结果是()。include<iostream.h> void main{int num=1:int&ref=num; ref
下面程序的运行结果是()。
include<iostream.h> void main
{
int num=1:
int&ref=num; ref=ref+2:
cout<<num: num=num+3: cout<<ref<<endl:
}
A.13
B.16
C.36
D.33
-
下面程序的运行结果是()。 include<iostream.h> void fun(int *a,int *B. { int x=*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 12
B.12 21
C.21 12
D.21 21
-
下列程序的运行结果为include<iostream.h>void main(){int a=2;int b=a+1;cout < < a/b < < endl;}
A.0.66667
B.0
C.0.7
D.0.66666666…
-
下列程序的运行结果为include < iostream.h >void main(){ int a=2; int b=a+l; cout < < a/b
下列程序的运行结果为 include < iostream.h > void main() { int a=2; int b=a+l; cout < < a/b < < end1; }
A.0.66667
B.0
C.0.7
D.0.66666666…
-
下面程序的结果为()。include<iostream.h>void change(int a,int b){int temp;temp=a;a=b;b=temp
下面程序的结果为()。 include<iostream.h> void change(int a,int b) { int temp; temp=a; a=b; b=temp; } void main() { int m,n; m=8; n=9; change(m,n); cout<<m<<""<<n<<endl; }
A.89
B.98
C.程序有错误
D.99
-
运行程序,程序输出结果是(). include <iostream> using namespace std; int main() { ch
运行程序,程序输出结果是(). include <iostream> using namespace std; int main() { char str[100]="program",*p=str; str[3]=0; cout<
< <endl; return> A、ogram
B、r
C、o
D、pro
</endl;>
-
下面程序的运行结果是【】。 include<iostream> using namespace std; void fun(int&a,int b=3)
下面程序的运行结果是【 】。
include <iostream>
using namespace std;
void fun(int &a, int b=3)
{
static int i=2;
a = a + b + i;
i = i + a;
}
int main()
{
int x=5, y=2;
fun(x, y);
cout<<x<<",";
fun(x);
cout<<x<<end1;
return 0;
}
-
下面程序的运行结果为 include<iostream.h> void main() { for(int a=0,x=0;! x&&a<=10;a++) { a++; } cout<<a<<end1; }
A.10
B.11
C.12
D.0
-
下面程序的运行结果是include<iostream.h>void main(){int i=1;while(i<=8)if (i%3!=2)cont
下面程序的运行结果是 include<iostream.h> void main() { int i=1; while(i<=8) if (i%3!=2)continue; else cout<<i; }
A.25
B.36
C.258
D.369
-
下面程序的运行结果为()。 include<iostream.h> voidmain() { chara=3: switch(a) {
下面程序的运行结果为()。 include<iostream.h> voidmain() { chara=3: switch(a) { case3:cout<<"3"; case2:cout<<"2";break; default:cout<<"1"; } }
A.3
B.321
C.31
D.32
-
下列程序的运行结果为()。 include<iostream.h> void main { int a=2: int b=a+1: co
下列程序的运行结果为()。 include<iostream.h> void main { int a=2: int b=a+1: cout<<a/b<<endl:
A.0.66667
B.0
C.0.7
D.0.66666666…
-
下面程序的运行结果是()。 include<iostream.h> int fun(int a[],int n) { int resuh=1
下面程序的运行结果是()。 include<iostream.h> int fun(int a[],int n) { int resuh=1; for(inl i=1;i<11;1‘++) result=result * a[i]; retum result; } void main int a[3]={3,4,5}: cout<<fun(a,3)<<endl: }
A.12
B.15
C.20
D.60
-
下面程序的运行结果是include<iostream.h>Void main(){int num=1;int &ref=num;ref=ref+2;cout < < num;num=num+3;cout < < ref < <endl;}
A.13
B.16
C.36
D.33
-
下列程序的运行结果为include<iostream.h>int i=0;class A{public: A(){i++;}};void main(){
下列程序的运行结果为 include<iostream.h> int i=0; class A{ public: A(){i++;} }; void main() { A a,b[3] ,*c; c=b; cout << i << end1; }
A.2
B.3
C.4
D.5
-
下面程序段的运行结果是 include<iostream.h> void main() {char*s="abcde"; S+=2;
下面程序段的运行结果是 include<iostream.h> void main() { char*s="abcde"; S+=2; cout<<&s;}
A.cde
B.字符'c'
C.字符'c'的地址
D.无确定的输出结果