网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
有如下程序void f(int *x,int *y){ int t; t=*x;*x=*y;*y=t;}main(){ int a[6]={1,2,4,6,8,10},i,*p,*q; p=a;q=&a[5]; while(p<q) { f(p,q); p++; q--; } for(i=0;i<6;i++) printf("%d,",a[i]);}该程序的输出结果是A.1,2,4,6,8,10 B.10,8,4,6,2,1C.10,8,6,4,2,1 D.10,2,4,6,8,1
参考答案
更多 “ 有如下程序void f(int *x,int *y){ int t; t=*x;*x=*y;*y=t;}main(){ int a[6]={1,2,4,6,8,10},i,*p,*q; p=a;q=a[5]; while(pq) { f(p,q); p++; q--; } for(i=0;i6;i++) printf("%d,",a[i]);}该程序的输出结果是A.1,2,4,6,8,10 B.10,8,4,6,2,1C.10,8,6,4,2,1 D.10,2,4,6,8,1 ” 相关考题
考题
以下程序的输出结果是 【 11 】 。#include stdio.hvoid swap(int *a,int *b){ int *t;t=a; a=b; b=t;}main(){ int i=3,j=5,*p=i,*q=j;swap(p,q); printf("%d %d\n",*p,*q);}
考题
有以下程序:void f(int *x,int *y){ int *t; t=x; x=y ;y=t; *x=*y;}main(){ int a[8]={1,2,3,4,5,6,7,8},i,*p,*q; p=a;q=a[7]; while(pq) { f(p,q);p++;q--} for(i=0;i8;i++)printf("d,",a[i]);}程序运行后的输出结果是( )。A.8,2,3,4,5,6,7,1,B.5,6,7,8,1,2,3,4,C.1,2,3,4,5,6,7,8,D.8,7,6,5,4,3,2,1,
考题
下列程序的输出结果是( )。 void f(int*x,int*y) {int t; t=*x,*x=*y;*y=t; } main() {int a[8]={1,2,3,4,5,6,7,8},i,*p,*q; p=a;q=a[7]; while(p<q) {f(p,q);p++;q--;} for(i=0;i<8;i+)printf("%d,",a[i]); }A.8,2,3,4,5,6,7,1B.5,6,7,8,1,2,3,4C.1,2,3,4,5,6,7,8D.8,7,6,5,4,3,2,1
考题
有以下程序 int *f(int *x,int *y) { if(*x<*y) return x; else return y; } main( ) { int a=7,b=8,*p,*q,*r; p=a; q=b; r=f(p,q); printf("%d,%d,%d\n",*p,*q,*r); } 执行后输出结果是A.7,8,8B.7,8,7C.8,7,7D.8,7,8
考题
以下程序的输出结果是 【11】 。int fun(int x,int y,int *p,int *q){ *p=x*y;*q=x/y;}main(){int a,b,c,d;a=4;b=3;fun(a,b,c,d);printf("%d,%d\n",c,d);}
考题
以下程序运行后的输出结果【 】。struct NODE{int k;struct NODE *link;};main(){structNODEm[5],*p=m,*q=m+4;int i=0;while(p!=q){p->k=++i;p++;q->k=i++;q-;}q->k=i;for(i=0;i<5;i++)printf("%d",m[i].k);printf("\n");}
考题
下列程序的输出结果是【 】。include void swap(int *a, int *B) { int *t; t=a;a=b;b=t;
下列程序的输出结果是【 】。include <stdio.h>void swap(int *a, int *B){int *t;t=a;a=b;b=t;}main(){int i=3,j=5,*p=i,*q=j;swap(p,q);printf("%d %d\n",*p,*q);}
考题
下面程序的结果【】。 include int f(int); void main() { int x=1,i; for (i=0; i
下面程序的结果【 】。include<iostream.h>int f(int);void main() {int x=1, i;for (i=0; i<3; i++)cout<<f(x)<<‘ ’ ;cout<<end1;}int f(int x){int y=1;static int z=3y++;z++;return (x+y+z);}
考题
以下程序的输出结果是______。include void swap(int *a, int *b){ int *t;}{ int i=3,j
以下程序的输出结果是______。include <stdio.h>void swap(int *a, int *b){ int *t;}{ int i=3,j=5,*p=i,*q=j;swap(p,q); printf("%d %d\n",*p,*q);
考题
有以下程序 int *f(znt *x,int *y) { if(*x<*y) return X; else return y; } main() { int a=7,b=8,*p,*q,*r; p=a; q=b; r=f(p,q); printf("%d,%d.%d\n",*p,*q,*r); } 执行后输出结果是A.7,8,8B.7,8,7C.8,7,7D.8,7,8
考题
有以下程序: int *f(int *x,int *y) {if(*x<*y)return x; else return y; } main() { int a=7,b=8,*p,*q,*r; p=a; q=b; r=f(p,q); printf("%d,%d,%d\n",*p,*q,*r); } 程序运行后输出结果是______。A.7,8,8B.7,8,7C.8,7,7D.8,7,8
考题
有以下程序 include void fun(int*a,int*B) { int*c; c=a;a=b;b=c; } main() {int x=3
有以下程序 #include<stdio.h> void fun(int*a,int*B) { int*c; c=a;a=b;b=c; } main() { int x=3, y=5,*p=x, *q=y; fun(p,q); printf("%d,%d,",*p,*q); fun(x,y); printf(" %d,%d\n",*p,*q); } 程序运行后的输出结果是______。A.3,5,5,3B.3,5,3,5C.5,3,3,5D.5,3,5,3
考题
有以下程序 void f(int *x,int *y) { int t; t=*X; *X=*y; *y=t; } main() { int a[8]={1,2,3,4,5,6,7,8},i,*p,*q; p=a; q=a[7); while(p>q) { f(p,q); p++; q--; } for(i=0; i<8; i++) printf("%d,",a[i]); } 程序运行后的输出结果是A.8,2,3,4,5,6,7,1,B.5,6,7,8,1,2,3,4,C.1,2,3,4,5,6,7,8,D.8,7,6,5,4,3,2,1,
考题
有以下程序: void f(int*x,int*y) { int t; t=*x;*x=*y;*y=t; } main() { int a [8]={1, 2,3,4,5, 6, 7,8},i,*p,*q; p=a;q=a[7]; while(p<q) {f(p,q);p++;q-;} for(i=0;i<8;i++)printf("%d,"a[i]); } 程序运行后的输出结果是 ______。A.823,4,5,6,7,1,B.5,6,7,8,12,3,4,C.1,2,3,4,5,6,7,8,D.8,7,6,5,4,3,2,1,
考题
下列程序的输出结果是( )。 void f(int *x, int *y) { int t; t=*x,*x=*y;*y=t; } main( ) { int a[8]={1,2,3,4,5,6,7,8},i,*p,*q; p=a;q=a[7]; while(p<q) { f(p,q); p+ +; q--;} for (i=0;i<8;i+) printf("%d,",a[i]); }A.8,2,3,4,5,6,7,1B.5,6,7,8,1,2,3,4C.1,2,3,4,5,6,7,8D.8,7,6,5,4,3,2,1
考题
下面程序的运行结果是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);}
考题
以下程序的输出结果是include "stdio.h"int *f(int *x,int *y){ if(*x*y) return x; else return y;}main(){ int a=7,b=8, *p,*q,*r ; p=a; q=b; r= f(p,q); printf("%d,%d,%d\n",*p,*q,*r);}
考题
有以下程序: voidf(int*x,int * y) { int t; t= *x;*x= *y;*y=t; } main() { inta[8]={1,2,3,4,5,6,7,8},i,*p,*q; p=a;q=a[7]; while(p) { f(p,q);p++;q--;} for(i=0;i<8;i++)printf("%d,",a[i]); } 程序运行后的输出结果是______;A.8,2,3,4,5,6,7,1,B.5,6,7,8,1,2,3,4,C.1,2,3,4,5,6,7,8,D.8,7,6,5,4,3,2,1,
考题
阅读以下函数说明和C语言函数,将应填入(n)处的字句写在对应栏内。【函数2.1】void sort(char *s,int num){int i,j--num;char t;while(j-->1)for(i=0;i<j;i++)if(s[i]>s[i+1]){t=s[i];s[i]=s[i+1];s[i+1]=t;}void main(){char *s="CEAedea";sort(s,5);printf("%s",s);}上述程序的结果是(1)【函数2.2】void main(){ union {int ig[6];Char s[12];} try;try. ig[0]=0x4542; try.ig[1]=0x2049;try. ig[2]=0x494a; try.ig[3]=0x474e;try. ig[4]=0x0a21; try.ig[5]=0x0000;pintf("%s",try, s);}上述程序的结果是(2)【函数2.3】void main(){ char *letter[5]= { "ab","efgh","ijk","nmop","st"};char **p;int i;p=letter;for(i=0;i<4;i++) .printf("%s",p[i]);}上述程序的结果是(3)【函数2.4】main(){int i=4,j=6,k=8,*p=I,*q=j,*r=k;int x,y,z;x=p==i;y=3*-*p/(*q)+7;z=*(r=k)=*p**q;printf("x=%d,y=%d,z=%d",x,y,z);}上述程序的结果是(4)【函数2.5】int a[]={5,4,3,2,1 };void main(){int i;int f=a[0];int x=2;for(i=0;i<5;i++)f+=f*x+a[i];printf("%d",f);}上述程序的结果是(5)
考题
有以下程序 void f(int*x,int*y) { int t; t=*x;*x=*y;*y=t; } main() { int a[8]={1,2,3,4,5,6,7,8},i,*p,*q; p=a;q=a[7]; while(p { f(p,q);p++; q--; } for (i=0;i<8;i++)printf("%d,",a[i]); } 程序运行后的输出结果是______。A.8,2,3,4,5,6,7,1,B.5,6,7,8,1,2,3,4,C.1,2,3,4,5,6,7,8,D.8,7,6,5,4,3,2,1,
考题
请选出以下程序的输出结果()。includesub(int *s,int y){static int t=3; y=s[t];t--;}
请选出以下程序的输出结果( )。 #include <stdio.h> sub(int *s,int y) { static int t=3; y=s[t];t--; } main() { int a[]={1,2,3,4},i,x=0; for(i=0;i<4;i++) { sub(a,x);printf("%d",x); } printf("\n"); }A.1234B.4321C.0D.4444
考题
有以下程序: int*f(int*x,int*y) { if(*<*y)return x; else return y; } main() { int a=7,b=8,*p,*q,*r; p=a;q=b; r=f(p,q); printf("%d,%d,%d\n",*p,*q,*r); } 程序运行后输出结果是______。A.7,8,8B.7,8,7C.8,7,7D.8,7,8
考题
有以下程序:include void f(int * x,int * y) int t;t= *x; *x= *y; *y=t;main ( ){in
有以下程序:#include <stdio.h>void f(int * x,int * y) int t; t= *x; *x= *y; *y=t;main ( ){ int a[8] = { 1,2,3,4,5,6,7,8} ,i, * p, * q; p=a;q =a[7]; while(p<q) { f(p,q) ;p ++ ;q --; } for(i =0;i<8;i ++ ) printf(" % d," ,a[i]); }程序运行后的输出结果是( )。A.8,2,3,4.,5,6,7,1,B.5,6,7,8,1,2,3,4,C.1,2,3,4,5,6,7,8,D.8,7,6,5,4,3,2,1,
考题
下面程序和运行运行结果是【 】。void swap(int * a,int * b){ int * t;t=a; a=b; b=t;}main( ){ intx=3,y=5,* p=&x,* q=&y;swap(p,q);prinff("%d %d\n", *p, *q);}
考题
以下程序的输出结果是( )。 include void swap(int*a,int*B){int*t; t=a;a=b;b=c;} main
以下程序的输出结果是( )。 include<stdio.h> void swap(int*a,int*B){int*t; t=a;a=b;b=c;} main() {int i=3,j=5,*p=i,*q=j; swap(p,q);printf("%d %d\n",*p,*q); }
考题
单选题以下选项中,不能对主函数中变量i和j的值进行交换的程序是( )。A
#include stdio.hvoid swap(int *p, int *q){ int *t; *t = *p; *p = *q; *q = *t;}main(){ int i=10, j=20,*a=i,*b=j; swap(a,b); printf(i=%d j=%d,i,j);}B
#include stdio.hvoid swap(int *p, int *q){ int t; t = *p; *p = *q; *q = t;}main(){ int i=10,j=20,*a=i,*b=j; swap(a,b); printf(i=%d j=%d,i,j);}C
#include stdio.h#include stdlib.hvoid swap(int *p, int *q){ int *t; t = (int *)malloc(sizeof(int)); *t = *p; *p = *q; *q = *t; free(t);}main(){ int i=10,j=20; swap(i,j); printf(i=%d j=%d,i,j);}D
#include stdio.hvoid swap( int *p, int *q){ int t; t = *p; *p = *q; *q = t;}main(){ int i=10,j=20,*x=i,*y=j; swap(x,y); printf(i=%d j=%d,i,j);}
考题
单选题有以下程序:#include void fun(int*a,int*b){ int*c; c=a; a=b; b=c;}main(){ int x=3,y=5,*p=x,*q=y; fun(p,q); printf(%d,%d,*p,*q); fun(x,y); printf(%d,%d,*p,*q);}程序运行后的输出结果是( )。A
3,5,5,3B
3,5,3,5C
5,3,3,5D
5,3,5,3
热门标签
最新试卷