网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
下列程序运行后的结果是:_____ #include<stdio.h> int main() { int array[]={1,2,3,4,5},y=0x10,i,*p; p=array+3; for(i=0;i<4;i++) { y=y+*p; p--; } printf("%dn",y); return 0; }
参考答案和解析
c
更多 “下列程序运行后的结果是:_____ #include<stdio.h> int main() { int array[]={1,2,3,4,5},y=0x10,i,*p; p=array+3; for(i=0;i<4;i++) { y=y+*p; p--; } printf("%dn",y); return 0; }” 相关考题
考题
有以下程序#include stdio.hstruct tt{ int x;struct tt *y;} *p;struct tt a[4]={20,a+1,15,a+2,30,a+3,17,a};main(){ int i;p=a;for(i=1;i=2;i++) {printf("%d,",p-x); p=p-y;}}程序的运行结果是A)20,30,B)30,17C)15,30,D)20,15,
考题
有下列程序: include main() {int a[]={1,2,3,4},y,*p=a[3]; --
有下列程序: #include <stdio.h> main() {int a[]={1,2,3,4},y,*p=a[3]; --p; y=*p; printf("y=%d\n",y); } 程序的运行结果是( )。A.y=0B.y=1C.y=2D.y=3
考题
若有以下程序段:include using namespace std;int main (){ int a[]={1,4,5}; int *p
若有以下程序段: #include <iostream> using namespace std; int main () { int a[]={1,4,5}; int *p=a[0],x=6, y,z; for (y=0; y<3; y++) z= ( (* (p+y) <x) ? *(p+y) :x); cout<<z<<end1; return 0; } 程序运行后的输出结果是( )。A.1B.4C.5D.2
考题
以下程序运行后的输出结果是【】include main ( ) {char a[] ="123456789", *p;int i =0;
以下程序运行后的输出结果是【 】include <stdio.h>main ( ){ char a[] ="123456789", *p;int i =0;p=a;while( * p){ if(i%2 ==0) *p='*';p++;i++;}puts(a);}
考题
有以下程序:include main() {int a[] = {2,4,6,8,10} ,y =0,x, * p;p =a[1];for(
有以下程序: #include <stdio.h> main() { int a[] = {2,4,6,8,10} ,y =0,x, * p; p =a[1]; for(x=1;x<3;x++)y+ =p[x]; printf( "% d \n" , y); }程序运行后的输出结果是( )。A.10B.11C.14D.15
考题
有以下程序: include usingnamespacestd; intmain() { intnum[2][3],*p; intt,i,j,k=
有以下程序: #include <iostream> using namespace std; int main() { int num[2][3],*p; int t,i,j,k=10; p=num[0]; for(i=0;i<2;i++) { for(j=0;j<3;j++) { k++; *p=k; for(t=2;t<*p;t++) { if(!(*p%t)) { j--; *p--; break; } *p++; } } cout<<*(p-1)<<end1; return 0; } 程序运行后的输出结果是( )。A.19B.11C.29D.23
考题
若有以下程序:includeint a[]={2,4,6,8};main(){int i; int *p=a; for(i=0;i
若有以下程序: #include<stdio.h> int a[]={2,4,6,8}; main() { int i; int *p=a; for(i=0;i<4;i++) a[i]=*p; printf("%d\n",a[2]); } 上面程序的输出结果是( )。A.6B.8C.4D.2
考题
有以下程序 include struct tt { int x; struct tt *y; } *p; s
有以下程序 #include <stdio.h> struct tt { int x; struct tt *y; } *p; struct tt a[4]= {20,a+ 1,15,a+2,30,a+3,17,a}; main() { int i; p=a; for(i=1; i<-2; i++) { printf("%d,", p->x ); p=p->y; }A.20,30,B.30,17C.15,30,D.20,15,
考题
下面程序的运行结果是( )。 include main() {char a[80],*p="AbabCDcd"; int i=0,j=0; w
下面程序的运行结果是( )。 include<stdio.h> main() {char a[80],*p="AbabCDcd"; int i=0,j=0; while(*(p++)!='\0') {if(*p>='a'*p<='z'){a[i]=*p;i++;} } a[i]='\0'; puts(A); }
考题
下面程序执行的结果是【 】。 include using namespace std; void main(){ int sum=0; i
下面程序执行的结果是【 】。include <iostream>using namespace std;void main(){int sum=0;int array[6]={1,2,3,4,5,6};int *p;p=array[0];for(int i=0;i<6;i++){sum=sum+*p;p++;}cout<<sum;}
考题
有以下程序:include main ( ){int a[3] [3] , *p,i; p=a[0][0];for(i=0;i
有以下程序: #include <stdio.h> main ( ) { int a[3] [3] , *p,i; p=a[0][0]; for(i=0;i<9; i++)p[i]=i: for(i=0; i<3;i++)Printf("%d",a[1][i]); } 程序运行后的输出结果是( )。A.012B.123C.234D.345
考题
有以下程序:includestruct tt{int x;struct tt*y;}*p;struct tt a[4]={20,a+1,15,a+2,
有以下程序: #include<stdio.h> struct tt {int x;struct tt*y;}*p; struct tt a[4]={20,a+1,15,a+2,30,a+3,17,a} main() { int i; p=a; for(i=1;i<=2;i++){printf("%d",p->x);p=P->y;} } 程序的运行结果是( )。A.20,30,B.30,17C.15,30D.20,15
考题
字符串str由数字字符组成(长度不超过5个字符),可看作任意进制的数,请补充函数fun(),该函数的功能是:把 str字符串转换成任意进制的数,结果保存在数组xx中,由函数返回转换后数组腆的实际长度。其中x表示str原来的进制, y表示要转换成的进制。例如,输入str=“1111”,x=2,y=10,结果输出:15。如果输入str=“15”, x=10,Y=2,结果输出: 1111。注意:部分源程序给出如下。请勿改动主函数main和其他函数中的任何内容,仅在函数fun()的横线上填入所编写的若干表达式或语句。试题程序:include <stdio.h>include<stdlib.h>include<string.h>define N 8int xx[N];int fun(char *str,int x,int y){int sum;int i=0;char *p=str;for(i=0; i<N; i++)xx[i]=0;sum=*p-'0';p++;while (*p){sum=【 】;p++;}i=0;while(sum!=0){xx[i]=【 】;【 】;i++;}return i;}main (){char str[6];int i;int n;int x;int y;printf("Enter a string made up of '0' to'9' digits character:");gets(str);if(strlen (str) 5){printf("Error:string too longer!,please input again!\n\n");exit(0);}for(i=0;str[i];i++)if(str[i]<'0'||str[i]>'9'){printf("Error:%c not is '0' to'9' digits character!\n\n",str[i]);exit(0);}printf("The original string: ");puts(str);printf("\nINPUT x= ");scanf("%d",x);printf("\nINPUT y= ");scanf("%d",y);n=fun(str,x,y);printf("\n%s is convered to",str);for (i=n-1; i=0; i--)printf("%d",xx[i]);}
考题
有以下程序 include define N 4 void fun(int a[][N],int b[]) { int
有以下程序 #include <stdio.h> #define N 4 void fun(int a[][N],int b[]) { int i; for(i=0;i<N;i++) b[i]=a[i][i]; } main() {int x[][N]={{1,2,3},{4},{5,6,7,8},{9,10} },Y[N],i; fun(x,y); for(i=0;i<N;i++) printf("%d,",y[i]); printf("\n"); } 程序的运行结果是______。A.1,2,3,4,B.1,0,7,0,C.1,4,5,9,D.3,4,8,10,
考题
若有以下程序includeint a[]={2,4,6,8};main(){int i; int *p=a; for(i=0;i
若有以下程序 #include <stdio.h> int a[]={2,4,6,8}; main() { int i; int *p=a; for(i=0;i<4;i++)a[i]=*p; printf("%d\n",a[2]);} 上面程序输出结果是A.6B.8C.4D.2
考题
下述程序的输出结果是()。includevoid main(){int a[20],*p[4];int i,k=0;for(i=0;i
下述程序的输出结果是( )。 #include<stdio.h> void main() {int a[20],*p[4]; int i,k=0; for(i=0;i<20;i++) a[i]=i; for(i=0;i<4;i++) p[i]=a[i*i+1]; for(i=0;i<4;i++) {k=k+*p[i];} printf("%d",k); }A.10B.18C.6D.数组元素引用不合法,输出结果不定
考题
请读程序: includeint a[]={2,4,6,8};main (){ int i;int * p=a;for(i=0;i
请读程序: # include<stdio.h> int a[]={2,4,6,8}; main ( ) { int i; int * p=a; for(i=0;i<4;i + +)a[i]=* p + +; printf("%d\n”,a[2]); } 上面程序的输出结果是 ( )A.6B.8C.4D.2
考题
下面程序的输出结果是( )。 #include "stdio.h" fun (x int x { int y=0; static int z=5; z=x++,y++; return(Z); } main() { int a=4,i,j; for(i=0;i<2;i++) j=fun(a++); printf("%d",j); }A.0B.3C.4D.5
考题
有以下程序:includemain() {int a[3][3],*p,i; p=a[0][0]; for(i=0;i
有以下程序: #include <stdio.h> main() { int a[3][3],*p,i; p=a[0][0]; for(i=0;i<9;i++) p[i]=i+1; printf("%d\n",a[1][2]); } 程序运行后的输出结果是( )。A.3B.6C.9D.2
考题
有以下程序:includemain(){int a[]={1,2,3,4},y,*p=--p;y=*p;printf("y=%d\n",y
有以下程序: #include<stdio.h> main() { int a[]={1,2,3,4},y,*p=&a[3]; --p;y=*p;printf("y=%d\n",y); } 程序的运行结果是( )。A.y=0B.y=1C.y=2D.y=3
考题
请读程序:includeint a[]={2,4,6,8,};main(){int i; int *p=a; for( i=0;i
请读程序: #include <stdio.h> int a[]={2,4,6,8,}; main() { int i; int *p=a; for( i=0;i<4;i++) a[i]=*p++; priatf("%d\n",a[2]); } 上面程序的输出结果是( )。A.6B.8C.4D.2
考题
若有以下程序 include int a[ ]={2,4,6,8}; main( ) { int i; int *p=a; for(i=0;i
若有以下程序#include <stdio.h>int a[ ]={2,4,6,8};main( ){ int i;int *p=a;for(i=0;i<4;i++) a[i]=*p;printf("%d\n",a[2]);}上面程序的输出结果是A.6B.8C.4D.2
考题
下列程序的输出结果是()。 inClude main() {charch[2][5]={"1234","5678"},*p[2]; int
下列程序的输出结果是( )。#inClude<stdio.h>main(){ charch[2][5]={"1234","5678"},*p[2];int i,j,s=0;for(i=0;i<2;i++)p[i]=ch[i];for(i=0;i<2;i++)for(j=0;p[i][j]>'\0';j+=2){ s=p[i][j]-'0';printf("%d",s);}}A.6357B.6135C.1357D.691357
考题
下列程序执行后的输出结果是()。includemain(){int a[3][3],*p,i; p=a[0][0]; for
下列程序执行后的输出结果是( )。 #include <stdio.h> main() { int a[3][3],*p,i; p=a[0][0]; for(i=1;i<9;i++) p[i]=i+1; printf("%d\n",a[1][2]); }A.3B.6C.9D.随机数
考题
有以下程序:includestxucttt{ intx;structtt *y;}*p;struct tta[4]={20,a+1,15,a+2,30
有以下程序: #include <stdio.h> stxuct tt { int x;struct tt *y;}*p; struct tt a[4]={20,a+1,15,a+2,30,a+3,17,a}; main() { int i; p=a; for(i=1;i<=2;i++) {printf("%d,",p->x ); p=p->y;} } 程序的运行结果是( )。A.20,30,B.30,17C.15,30,D.20,15,
考题
有以下程序: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,
考题
单选题有如下程序:#include int *sum(int data){ static int init=0; init+=data; return init;}main(){ int i,*p; for(i=1;i=4;i++) sum(i); p=sum(0); printf(%d,*p);}程序运行后的输出结果是( )。A
15B
0C
1D
10
考题
单选题有以下程序:#include main(){ char *s[6]={ABCD,EFGH,IJKL,MNOP,QRST,UVWX},**p; int i; p=s; for(i=0;i4;i++)printf(%s,p[i]); printf();}程序运行后的输出结果是( )。A
ABCDEFGHIJKLMNOPB
ABCDEFGHHKLC
ABCDD
AEIM
热门标签
最新试卷