[单选题]

下面程序的运行结果为()。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,3

B.3,2

C.2,2

D.3,3

参考答案与解析:

相关试题

下面程序的运行结果为#includeVoid swap(int &a,int b

[单选题]下面程序的运行结果为includeVoid 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,3B.3,2C.2,2D.3,

  • 查看答案
  • 下面程序的运行结果为#includevoid main( ){ for(int

    [单选题]下面程序的运行结果为includevoid main( ){ for(int a=0,x=0;!x&&a<=10;a£«下面程序的运行结果为 #include<iostream.h> void main( ) { for(int a=0,x=0;! x&&a<=10;a++) { a++; } cout<<a<<end1; }A.10B.11C.12D.0

  • 查看答案
  • 下面程序的运行结果为 #include void swap(int &a, in

    [单选题]下面程序的运行结果为 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

  • 查看答案
  • 下面程序的运行结果是void swap(int *a,int *b){ int

    [主观题]下面程序的运行结果是void swap(int *a,int *b){ int *t; t=a;a=b;b=t;}main(){ int x=3,y=5,*p=&x,*q=&y; swap(p,q); printf("%d%d/n",*p,*q);}

  • 查看答案
  • 下面程序的运行结果是#includevoid fun(int * a,int *

    [单选题]下面程序的运行结果是includevoid fun(int * a,int * b){ int x= * a; * a = * b;*下面程序的运行结果是 #include<iostream.h> void fun(int * a,int * b) { int x= * a; * a = * b; * b=x; cout <<*a<< *b<<""; } void main( 0 { int x =1,y =2; fun(&x,&y); cout<< x << y <<end

  • 查看答案
  • 下面程序输出的结果为()。#includevoid fun(int a,int

    [单选题]下面程序输出的结果为()。includevoid fun(int a,int b){int temp;temp=a;a=b;b=tem下面程序输出的结果为( )。 #include<iostream.h> void fun(int a,int b) { int temp; temp=a; a=b; b=temp; } void main() { int m,n; m=1; n=2; fun(m,n); cout<<m<<""<<n<<end1; }A.12B.21C.22D.程序有错误

  • 查看答案
  • 下列程序的运行结果为( )。 includevoid main { int a=

    [单选题]下列程序的运行结果为( )。 includevoid main { int a=2: int b=a+1: cout<<a/b<<endl:A.0.66667B.0C.0.7D.0.66666666…

  • 查看答案
  • 下面程序的运行结果是#includevoid main( 0{ int num

    [单选题]下面程序的运行结果是includevoid main( 0{ int num =1; int &ref = num; ref=下面程序的运行结果是 #include<iostream.h> void main( 0 { int num =1; int &ref = num; ref=ref+2; cout << num; num = num+3; cout < < ref < < end1; }A.13B.16C.36D.33

  • 查看答案
  • 下面程序的运行结果是#includevoid main(){ int i=1;

    [单选题]下面程序的运行结果是includevoid main(){ int i=1; while(i<=8) if (£«£«i%3!=2)con下面程序的运行结果是 #include<iostream.h> void main() { int i=1; while(i<=8) if (++i%3!=2)continue; else cout <<i; }A.25B.36C.258D.369

  • 查看答案
  • 下面程序的运行结果是#includevoid delch(char*s){int

    [单选题]下面程序的运行结果是includevoid delch(char*s){int i,j;char *a;a=S;for(i=0,j=0;a[下面程序的运行结果是 #include<stdio.h> void delch(char *s) { int i,j; char *a; a=S; for(i=0,j=0;a[i]!='/0';i++) if(a[i]>='0' &aa[i]<='9') {s[j]=a[i]; j++;} s[j]='/0';} main() { c

  • 查看答案
  • 下面程序的运行结果为()。#includevoid swap(int &a,in