有以下程序段int?a[10]={1,2,3,4,5,6,7,8,9,10},*p=a[3],b;b=p[5];b中的值是()A、5B、6C、8D、9
有以下程序段int?a[10]={1,2,3,4,5,6,7,8,9,10},*p=&a[3],b;b=p[5];b中的值是()
- A、5
- B、6
- C、8
- D、9
相关考题:
有以下程序#include stdio.hint b=2;int fun(int *k){ b=*k+b; return (b);}main(){ int a[10]={1,2,3,4,5,6,7,8},i;for(i=2;i4;i++) {b=fun(a[i])+b; printf("%d ",b);}printf("\n");}程序运行后的输出结果是A)10 12B)8 10C)10 28D)10 16
有以下程序: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,
以下程序段的输出结果是[ ]。 include void ref(int i); void main(){int val=1 以下程序段的输出结果是 [ ] 。include<iostream.h>void ref(int i);void main(){int val=1;cout<<“旧值:”<<val<<end1;ref(val);cout<<”新值:”<<val<<end1;}void ref(int i){i=10;}
(35)有以下程序#include stdio.hint b=2;int fun(int *k){ b=*k+b;return(b);}main(){ int a[10]={1,2,3,4,5,6,7,8},I;for(i=2;i4;i++) {b=fun(a)+b;printf(“%d”,b);}printf(“\n”);}程序运行后输出的结果是A)10 12 B)8 10 C)10 28 D)10 16
有以下程序:includeusing namespace std;class A{private:int a;public:A(int i){a=i 有以下程序: #include<iostream> using namespace std; class A {private: int a; public: A(int i) {a=i;} void disp() {cout<<a<<“,”;}}; class B {private: int b; public: B(int j) {b=j;} void disp() {cout<<b<<“,”;A.10,10,10B.10,12,14C.8,10,12D.8,12,10
有以下程序#inculde stdio.h#deFine N8void Fun(int * x,int i)main(){ int a[N]={1,2,3,4,5,6,7,8},i;Fun(a,2);For(i=0;iN/2;i++){ printF(“%d”,a[i]);}PrintF(“\n”);}程序运行后的输山结果是A.1313B.2234C.3234D.1234
有以下程序: include using namespace std; int main() {int i=010,j=10;cout 有以下程序:include <iostream>using namespace std;int main(){int i=010,j=10;cout<<(++i)<<","<<i--<<end1;return 0;}则该程序运行后的输出结果是【 】。
以下程序段给数组A的所有元素输入数据,请填空。 include void main () {int a[10], 以下程序段给数组A的所有元素输入数据,请填空。include<iostream. h>void main () {int a[10], i;i=0;while (i<10) cin>> 【 】}
有以下程序:includeusing namespace Std;inta;int fun();int main(){ externinta; in 有以下程序: #include <iostream> using namespace Std; int a; int fun(); int main() { extern int a; int b; a = 100; b = fun(); cout<<b<<end1; return 0; } int fun() { extern int a; return (10*A); } 其程序运行后的输出结果是( )。A.100B.10C.1000D.10000
有以下程序段: int k=0,a=1,b=2,c=3; k=ac?c:k; 执行该程序段后,k的值是 有以下程序段: int k=0,a=1,b=2,c=3; k=a<b?b:a; k=k>c?c:k; 执行该程序段后,k的值是 ______。A.3B.2C.1D.0
有以下程序段:includedefine MAX(x,y)(x)>(y)?(x):(y)void main(){ int i,j,k; i= 有以下程序段: #include<iostream.h> #define MAX(x,y)(x)>(y)?(x):(y) void main() { int i,j,k; i=10; j=15;k=MAX(i,j)*10; cout<<k<<end1; } 程序执行后的输出结果是( )。A.15B.100C.150D.10
有以下程序:includeusing namespace std;int a;int fun();int main(){externint a;in 有以下程序: #include<iostream> using namespace std; int a; int fun(); int main() { externint a; int b; a=10; b=fun(); cout<<b<<end1; return 0; } int fun() { extern int a; return(10*a); } 其程序运行后的输出结果是( )。A.10B.1C.100D.1000
以下程序段给数组所有的元素输入数据,请选择正确答案填入。 include main() { int a[10 以下程序段给数组所有的元素输入数据,请选择正确答案填入。 #include<stdio.h> main() { int a[10]=0; while(i<10)scan("%d"______); : : }A.a+(i++)B.a[i+1]C.a+iD.a[++i]
有以下程序includeintt b=2;int fun(int*k) {b=*k+b;return(b);}main(){int a[10]={1, 有以下程序 #include<stdio.h> intt b=2; int fun(int*k) {b=*k+b;return(b);} main() { int a[10]={1,2,3,4,5,6,7,8,},i; for(i=2;i<4;i++) {b=fun(a[i])+b; printf("%d",b);} print("\n"); } 程序运行后的输出结果是______。A.10 12B.8 10C.10 28D.10 16
有以下程序段:include define MIN(x,y)(x) 有以下程序段:include<iostream.h>define MIN(x,y) (x)<(y)?(x):(y)void main(){int i,j,K;i=10;j=15;k=10*MIN (i,j);cout<<k<<endl;}程序执行后的输出结果是______。
有以下程序 include include int fun(int n) {int * 有以下程序 #include <stdio.h> #include <stdlib.h> int fun(int n) {int *p; p=(int*)malloc(sizeof(int)); *p=n; return *p; } { int a; a=fun(10); printf("%d\n",a+fun(10)); } 程序的运行结果是______。A.0B.10C.20D.出错
有以下程序:includeint fun(int*k){int b=0;b=*k+b:return(B);}main(){int a[10]={1,2 有以下程序: #include<stdio.h> int fun(int*k) {int b=0; b=*k+b: return(B);} main() {int a[10]={1,2,3,4,5,6,7,8},i; for(i=2;i<4;i++){printf("%d",fun(a[i]));} printf("\n"); } 程序运行后的输出结果是( )。A.10 12B.8 10C.3 4D.10 28
有以下程序includeusing namespace std;int a;int fun();int main(){extern int a;in 有以下程序 #include<iostream> using namespace std; int a; int fun(); int main() { extern int a; int b; a=100; b=fun(); cout<<b<<endl; return 0; } int fun() { extern int a; return(10*a); } 其程序运行后的输出结果是( )。A.100B.10C.1000D.10000
有以下程序:includedefine N 8void fun(int*x,int i){*x=*(x+i)+1;}main(){int a[N]= 有以下程序: #include<stdio.h> #define N 8 void fun(int*x,int i) {*x=*(x+i)+1;} main() {int a[N]={1,2,3,4,5,6,7,8},i; fun(a,2); for(i=0;i<N/2;i++) {printf("%d",a[i]);} printf("\n"); } 程序运行后的输出结果是( )。A.1 3 1 3B.3 2 3 4C.4 2 3 4D.1 2 3 4
有以下程序include using namespace std;int a;int fun ();int main (){extern int a 有以下程序#include <iostream>using namespace std;int a;int fun ();int main (){ extern int a; int b; a = 100; b = fun(); cout<<b<<end1; return 0;}int fun{){ extern int a; return (10*a ;} 其程序运行后的输出结果是A.100B.10C.1000D.10000
有以下程序: 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,
有以下程序: #includestdio.h #define N 8 void fun(int*x,int i) {*x=*(x+i);) main( ) { int a[N]={1,2,3,4,5,6,7,8},i; fun(a,2); for(i=0;iN/2;i++) {printf("Ha",a[i]);} printf("\n"); } 程序运行后的输出结果是( )。A.1313B.2234C.3234D.1234
有以下程序段:int k=0,a=1,b=2,c=3;k=ac ? c:k;执行该程序段后,k的值是()。A.3B.2C 有以下程序段: int k=0,a=1,b=2,c=3; k=a<b ? b:a; k=k>c ? c:k; 执行该程序段后,k的值是( )。A.3B.2C.1D.0
以下程序的执行结果是()。includeint fun(int b[],int n){int i,r=1;for(i=0;i 以下程序的执行结果是( )。 #include<iostream.h> int fun(int b[],int n) { int i,r=1; for(i=0;i<n;i++) r=r*b[i]; } void main() { int x,a[]={1,2,3,4,5,6,7,8}; x=fun(a,3); cout<<x<<endl; }A.5B.6C.7D.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,
下列程序的运行结果是______。include int Func(int *a,int n) {int s=1; for(int i=0 下列程序的运行结果是______。include<iomanip.h>int Func(int *a,int n){int s=1;for(int i=0;i<n;i++)s*=*a++;returns;}void main(){inta[]:{1,2,3,4,5,6,7,8};intb=Func(a,6)+Func(a[5],2);cout<<“b=“<(b<<endl;}
单选题有以下程序:#includeint b=2;int fun(int *k){ b=*k+b; return(b);}main(){ int a[10]={1,2,3,4,5,6,7,8},i; for(i=2;i4;i++) { b=fun(a[i])+b; printf(%d,b); } printf();}程序运行后的输出结果是( )。A1012B810C1028D1016
单选题有以下程序:#include #define N 8void fun(int *x,int i){ *x=*(x+i);}main(){ int a[N]={1,2,3,4,5,6,7,8},i; fun(a,2); for(i=0;i { printf("%d,",a[i]); } printf("");}程序运行后的输出结果是( )。A1,3,1,3,B2,2,3,4,C3,2,3,4,D1,2,3,4,