• 2022-06-14 问题

    若有定义int a, b;则用( )定义的函数,执行语句swap(&a, &b);后,变量a与b的值没有交换。 A: swap(int *p, int *q) { int *t; t=(int*)malloc(sizeof(int)); //分配4个字节的存储空间给t *t=*p;*p=*q;*q=*t; } B: swap(int*p, int*q) { int t; t=*p;*p=*q;*q=t; } C: swap(int *p, int *q) { int *t; t=p; p=q; q=t; } D: swap(int *p, int *q) { int a, *t=&a; *t=*p; *p=*q; *q=*t; }

    若有定义int a, b;则用( )定义的函数,执行语句swap(&a, &b);后,变量a与b的值没有交换。 A: swap(int *p, int *q) { int *t; t=(int*)malloc(sizeof(int)); //分配4个字节的存储空间给t *t=*p;*p=*q;*q=*t; } B: swap(int*p, int*q) { int t; t=*p;*p=*q;*q=t; } C: swap(int *p, int *q) { int *t; t=p; p=q; q=t; } D: swap(int *p, int *q) { int a, *t=&a; *t=*p; *p=*q; *q=*t; }

  • 2022-06-14 问题

    定义一个函数实现交换x和y的值,并将结果正确返回。能够实现此功能的是()。 A: swap(int x, int y){ int t;<br/>t=x; x=y; y=t; } B: swap(int *x, int *y){ int<br/>t; t=x; x=y; y=t; } C: swap(int *x, int *y){ int<br/>t; t= *x; *x = *y; *y=t; } D: swap(int *x, int *y){ int<br/>*t; t=x; x=y; y=t; }

    定义一个函数实现交换x和y的值,并将结果正确返回。能够实现此功能的是()。 A: swap(int x, int y){ int t;<br/>t=x; x=y; y=t; } B: swap(int *x, int *y){ int<br/>t; t=x; x=y; y=t; } C: swap(int *x, int *y){ int<br/>t; t= *x; *x = *y; *y=t; } D: swap(int *x, int *y){ int<br/>*t; t=x; x=y; y=t; }

  • 2022-06-14 问题

    下列关系式正确的是()。 A: t(°F)= 1.8t(℃)+32 B: T(K)=t(℃)+273.15 C: t(℃)=5/9[t(°F)-32] D: 以上全部

    下列关系式正确的是()。 A: t(°F)= 1.8t(℃)+32 B: T(K)=t(℃)+273.15 C: t(℃)=5/9[t(°F)-32] D: 以上全部

  • 2021-04-14 问题

    #include int f(int t[],int n); main() {int a[4]={1,2,3,4},s; s=f(a,4); printf(“%d”,s); } int f(int t[],int n) {if (n>0) return t[n-1]+f(t,n-1); else return 0;} 程序运行后的输出结果是

    #include int f(int t[],int n); main() {int a[4]={1,2,3,4},s; s=f(a,4); printf(“%d”,s); } int f(int t[],int n) {if (n>0) return t[n-1]+f(t,n-1); else return 0;} 程序运行后的输出结果是

  • 2022-05-29 问题

    有以下程序 void swapl(int c&#91;&#93;) int t; t=c&#91;0&#93;;c&#91;0&#93;=c&#91;1&#93;;c&#91;1&#93;=t; void swap2(int c0,int c1) int t; t=c0;c0=c1;c1=t; main() int a&#91;2&#93;=3,5,b&#91;2&#93;=3,5; swapl( A: ;swap2(b[0],b[1]);

    有以下程序 void swapl(int c&#91;&#93;) int t; t=c&#91;0&#93;;c&#91;0&#93;=c&#91;1&#93;;c&#91;1&#93;=t; void swap2(int c0,int c1) int t; t=c0;c0=c1;c1=t; main() int a&#91;2&#93;=3,5,b&#91;2&#93;=3,5; swapl( A: ;swap2(b[0],b[1]);

  • 2022-05-29 问题

    有以下程序: void swap1(int C&#91;&#93;) int t; t=c&#91;0&#93;; c&#91;0&#93;=C&#91;1&#93;; c&#91;1&#93;=t; void swap2(int c0, int c1) int t; t=c0; c0=c1; c1=t; main() int a&#91;2&#93;=3,5, b&#91;2&#93;=3,5); swapl( A: ; swap2(b[0],b[1]); B: &

    有以下程序: void swap1(int C&#91;&#93;) int t; t=c&#91;0&#93;; c&#91;0&#93;=C&#91;1&#93;; c&#91;1&#93;=t; void swap2(int c0, int c1) int t; t=c0; c0=c1; c1=t; main() int a&#91;2&#93;=3,5, b&#91;2&#93;=3,5); swapl( A: ; swap2(b[0],b[1]); B: &

  • 2022-05-28 问题

    int a = -21, b=32, max; max=a>b ? a : b; 执行后max的 A: 32 B: -21

    int a = -21, b=32, max; max=a>b ? a : b; 执行后max的 A: 32 B: -21

  • 2021-04-14 问题

    int main(){ int t=98765,x; do ...ile(t!=0) return 0;}

    int main(){ int t=98765,x; do ...ile(t!=0) return 0;}

  • 2021-04-14 问题

    以下关于swap函数的功能叙述中,正确的是()。 Void swap(int a,int b) {int t; t=a;a=b;b=t; }

    以下关于swap函数的功能叙述中,正确的是()。 Void swap(int a,int b) {int t; t=a;a=b;b=t; }

  • 2021-04-14 问题

    下面算法的时间复杂度是 int p1( int n) { t = 1; while( t <= n) t *= 2; return t; }

    下面算法的时间复杂度是 int p1( int n) { t = 1; while( t <= n) t *= 2; return t; }

  • 1 2 3 4 5 6 7 8 9 10