已知函数原型为:structtree*f(intx1,int*x2,structtreex3,structtree*x4),其中tree为已定义的结构体类型,且有下列变量定义:structtreept,*p;inti;请选择正确的函数调用语句()A、pt=f(10,i,pt,p);B、p=f(i++,(int*)p,pt,pt);C、p=f(i+1,(i+2),*p,p)D、f(i+1,i,p,p);

已知函数原型为:structtree*f(intx1,int*x2,structtreex3,structtree*x4),其中tree为已定义的结构体类型,且有下列变量定义:structtreept,*p;inti;请选择正确的函数调用语句()

  • A、&pt=f(10,&i,pt,p);
  • B、p=f(i++,(int*)p,pt,&pt);
  • C、p=f(i+1,&(i+2),*p,p)
  • D、f(i+1,&i,p,p);

相关考题:

有以下程序#include string.hvoid f(char p[][10], int n ) /* 字符串从小到大排序 */{ char t[10]; int i,j;for(i=0;in-1;i++)for(j=i+1;jn;j++)if(strcmp(p[i],p[j])0) {strcpy(t,p[i]); strcpy(p[i],p[j]); strcpy(p[i],t); }}main( ){ char p[5][10]={"abc", " aabdfg","abbd", " dcdbe","cd"};f(p,5);printf("%d\n",strlen(p[0]));}程序运行后的输出结果是A) 2B) 4C) 6D) 3

有以下程序#includemain()void f(char p[][10], int n ) /* 字符串从小到大排序 */{ char t[10]; int i,j;for(i=0;ifor(j=i+1;jif(strcmp(p[i],p[j])0) {strcpy(t,p[i]); strcpy(p[i],p[j]); strcpy(p[i],t); }}main(){char p[5][10]={“abc”,”aabdfg”,”abbd”,”dcdbe”,”cd”};f(p,5);printf(“%d\n”,strlen(p[0]));}程序运行后的输出结果是( )。A.2B.4C.6D.3

已知函数的原形如下,其中结构体a为已经定义过的结构,且有下列变量定义struct a *f(int t1,int *t2,strcut a t3,struct a *t4)struct a p,*p1;int i;则正确的函数调用语句为A.p=f(10,i,p,p1);B.p1=f(i++,(int *)p1,p,p);C.p=f(i+1,(i+2),*p,p);D.f(i+1,i,p,p);

有以下程序 include void f(char p[][10],int n)/*字符串从小到大排序*/ { 有以下程序 #include<string.h> void f(char p[][10],int n)/*字符串从小到大排序*/ { char t[10];int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(strcmp(p[i],p[j])>0) {strcpy(t,p[i]);strcpy(p[i],p[j]);strcpy(p[j],t);} } main() { char p[5][10]={"abc","aabdfg:,"abbd","dcdbe","cd"}; f(p,5); printf("%d\n",strlen(p[0])); } 程序运行后的输出结果是A.2B.4C.6D.3

有以下程序,其中函数的功能是将多个字符串按字典顺序排序: includevoid f(char*p[],i 有以下程序,其中函数的功能是将多个字符串按字典顺序排序: # include<string.h> void f(char*p[],int n) {char *t; int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(strcmp(p[i],p[j])>0){t=p[i];p[i]=p[j]p[j]=t;} } main() {char *p[5]={"abc","aabdfg","abbd","dcdbe","cd"}; f(p,5); printf("%d\n",strlen(p[1])); } 程序运行后的输出结果是 ______。A.2B.3C.6D.4

有以下程序:includevoid f(char p[][10],int n)/* 字符串从小到大排序*/{char t[10]; 有以下程序: #include<string.h> void f(char p[][10],int n) /* 字符串从小到大排序 */ {char t[10];int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(strcmp(p[i],p[j])>0{strcpy(t,p[i]);strcpy(p[i],p[j]);strcpy([i],t);} } main() {char p[5][10]={"abc","aabdfg","abbd","dcdbe","cd"; f(p,5); printf("%d\n",strlen(p[0])); } 程序运行后的输出结果( )。A.2B.4C.6D.3

有以下程序,其中函数f的功能是将多个字符串按字典顺序排序#includestring.hvoidf(char*p[],intn){char*t;inti,j;for(i=0;in-1;i++)for(j=i+1;jn;j++)if(strcmp(p[i],p[j])0){t=p[i];p[i]=p[j];p[j]=t;}}main(){char*p[5]={“abc”,“aabdfg”,“abbd”,“dcdbe”,“cd”}。:A.2B.3C.6D.4

已知f1(int)是类A的公有成员函数,并将指针p定义为可以指向函数f1的指针类型,则可以实现让p是指向成员函数f1()的指针的语句为【 】。

在下列叙述中,正确的一条是( )A.语句int *pt中的*pt是指针变量名B.语句"int *p=a;"等价于"int *p;p=a[0];”C.运算符*和都是取变量地址的运算符D.已知指针变量p指向变量a,则a和*p值相同,都是变量a的值

有以下程序,其中函数f的功能是将多个字符串按字典顺序排序:include inelude 有以下程序,其中函数f的功能是将多个字符串按字典顺序排序:#include <stdio, h>#inelude <string, h>void f(char * p[ ] ,int n) char * t;int i,j; for(i=0;i<n-1;i++) for(j=i+1 ;j<n;j ++ ) if(strcmp(p[i], p[j])>0) { t =p[i];p[i] =p[j] ;p[j] =t;}}main( ){ char * p [5] = { "abe"." aabdfg"." abbd"," dcdbe"," cd" }; f(P,5 ); printf("% d\n", strlen(p[1]) );}程序运行后的输出结果是( )。A.2B.3C.60D.4

有以下程序,其中函数f的功能是将多个字符串按字典顺序排序: include void f(ch 有以下程序,其中函数f的功能是将多个字符串按字典顺序排序: #include<string.h> void f(char *p[],int n) {char *t;int i,j; for(i=O;i<n-1;i++) for(j=i+1;j<n;j++) if strcmp(p[i],p[j])>0{t=p[i] p[i]=p[j]; p[j]=t; } } main() {char* p[5]=("abc","aabdfg","abbd","dcdbe","cd"}; f(p,5); printf("%d\n",strlen(p[1])); } 程序运行后的输出结果是 ______。A.2B.3C.6D.4

有以下程序:includevoid f(char p[][10],int n){char t[10];int i,j;for(i=0;i 有以下程序: #include<string.h> void f(char p[][10],int n) {char t[10];int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(strcmp(p[i],p[j])>0) {strcpy(t,p[i]);strcpy(p[i],p[j]);strcpy(p[j],t);} } main() {char p[5][10]={"abc","aabdfg","abbd","dedbe","cd"}; f(p,5); printf("%d\n",strlen(p[0]));} 程序运行后的输出结果是( )。A.2B.4C.6D.3

以下程序中函数f的功能是将n个字符串按由大到小的顺序进行排序。includevoid f(char p 以下程序中函数f的功能是将n个字符串按由大到小的顺序进行排序。 #include<string.h> void f(char p[][10],int n) { char t[20];int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(strcmp(p[i],p[j]<0) {strcpy(t,p[i]);strcpy(p[i],p[j]);strcpy(p[j],t);} } main() { charp[][10]={“abc”,“aabdfg”,“abbd”,“dcdbe”,”cd”};int i; f(p,5);printf(“%d\n”,strlen(P[0])); } 程序运行后的输出结果是A.6B.4C.5D.3

有以下程序,其中函数f的功能是将多个字符串按字典顺序排序( )。 #includestring.h void f(char*p[],int n) { char*t;int i,j; for(i=0;in-1;i++) for(j=i+1;jn;j++) if(strcmp(p[i],p[j]0){t=p[i];p[i]=p[j];p[j] =t;} } main { char *P[5]={"abe","aabdfg","abbd","dcd- be","cd"}; f(p,5); printf("%d\n",strlen(p[1])); } 程序运行后的输出结果是( )oA.2B.3C.6D.4

设有如下函数定义。若在主函数中用语句cout<<f("good")调用上述函数,则输出结果为(48)。 int f(char *s){ char *p=s; while(*p! ='\0')p++; return(p-s); }A.3B.4C.5D.6

有以下程序,其中函数f的功能是将多个字符串按字典顺序排序:includevoidf(char*p[],in 有以下程序,其中函数f的功能是将多个字符串按字典顺序排序: #include<string.h> voidf(char*p[],intn) { char*t;int i,j; for(i=0;i<n-1;i++) for (j=i+1;j<n;j++) if(strcmp(p[i],p[j])>0) { t=p[i]; p[i]=p[j]; p[j]=t; } } main() { char*p[5]={"abc"A.2B.3C.6D.4

有以下程序:struct S{int n;int a[20];};void f(struct S*P){int i,j,t;for(i=0;in-1;i++)fo 有以下程序: struct S{int n;int a[20];}; void f(struct S*P) { int i,j,t; for(i=0;i<P->n-1;i++) for(j=j+1;j<P->n-1;j++) if(p->a[i]>p->a[j]) {t=P->a[i];p->a[i]=P->a[j];p->a[j]=t} } main() {int i;struct S s{10,{2,3,1,6,8,7,5,4,10,9}}; f(&s); for(i=0;i<s.n;i++)printf("%d",s.a[i]);} 程序运行后的输出结果是( )。A.3B.4C.5D.6

主程序调用findmax函数求出数组中最大元素在数组中的下标,括号中需填写的内容是#includestdio.hfindmax(int*s,int t,int *k){ int p;for(p=0, *k=p; pt; p++)if(s[p]s[*k])( ); }main(){ int a[10],i,k;for(i=0; i10;i++)scanf(" %d",a[i]);findmax(a,10,k);printf(" %d%d\n",k,a[k];) }A.k=pB.*k=pC.k=p-sD.*k=p-s

有以下程序,其中函数f的功能是将多个字符串按字典顺序排序includevoid f(char*p[],in 有以下程序,其中函数f的功能是将多个字符串按字典顺序排序 #include <string,h> void f(char *p[], int n) { char *t; int i,j; for(i=0; i<n-1; i++) for(j=i+1;j<n; j++) if(strcmp(p[i],p[j])>0) {t=p[i];p[i]=p[j]; p[j]=t;} } main() { char *p[5]={"abc","aabdfg","abbd","dcdbe","cd"}; f(p,5); printf("%d\n"。strlen(p[1])); } 程序运行后的输出结果是A.2B.3C.6D.4

以下程序中函数f的功能是将n个字符串按由大到小的顺序进行排序:includevoid f(char p 以下程序中函数f的功能是将n个字符串按由大到小的顺序进行排序: #include <string.h> void f(char p[][10],int n) { char t[20]; int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++ if(strcmp(p[i],p[j])<0) { strcpy(t,p[i]);strcpy(p[i],p[j]);strcpy(p[j],t); } } main() {char p[][10]:{"abc","aabdfg","abbd","dcdbe","cd",);int i; f(p,5); printf("%d\n",strlen(p[0])); } 程序运行后的输出结果是( )。A.6B.4C.5D.3

以下程序中函数f的功能是将n个字符串按由大到小的顺序进行排序。 include void f(char 以下程序中函数f的功能是将n个字符串按由大到小的顺序进行排序。 #include <string.h> void f(char p[][10], int n) { char t[20]; int i,j; for(i=0;i<n-1;i++) for(j=i+l;j<n;j++) if(strcmp (p[i],p[j])<0) { strcpy(t,p[i]);strcpy(p[i],p[j]);strcpy(p[j],t);} } main() { char p[][lO]-{"abc","aabdfg","abbd","dcdbe","cd"};int i; f(p,5); printf("%dkn",strlen(p[0])); } 程序运{亍后的输出结果是A.6B.4C.5D.3

有以下程序:include void f(char p[][10],int n)/* 字符串从小到大排序 */{ char t[1 有以下程序: #include <string.h> void f(char p[][10],int n)/* 字符串从小到大排序 */ { char t[10]; int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(strcmp(p[i],p[j])>0) { strcpy(t,p[i]); strcpy(p[i],p[j]); strcpy(p[j],t); } } main() {char p[5][10]={"abc","aabdog","abbd","dcdbe","cd"}; f(p,5); printf("%d\n",strlen(p[0])); } 程序运行后的输出结果是( )。A.2B.4C.6D.3

已知f1(int)是类A的公有成员函数,p是指向成员函数f1()的指针,采用赋值,( )是正确的。A.p=f1B.P=A::f1C.P=A::f1()D.P=f1()

用指针作函数参数,编程序求一维数组中的最大和最小的元素值。#define N 10main(){ void maxmin(int arr[],int *pt1,int *pt2,int n);int array[N]={10,7,19,29,4,0,7,35,-16,21},*p1,*p2,a,b;p1=a; p2=b;maxmin(array,p1,p2,N);printf("max=%d,min=%d",a,b);}void maxmin(int arr[],int *pt1,int *pt2,int n){ int i;*pt1=*pt2=arr[0];for(i=1;iN;I++){ if(arr[i]*pt1) (9) ;if(arr[i]*pt2) (10) ;}}

在下列现金流量图中,已知A、F和i,则P=( )。A、A(P/A,i,5)(P/F,i,1)+F(P/F,i,6) B、A(P/A,i,6)+F(P/F,i,6) C、A(P/A,i,5)+F(P/F,i,6) D、A(P/A,i,5)(P/F,i,2)+F(P/F,i,6)

已知现金流量如下图所示,计算F的正确表达式是( )。A:F=A(P/A,i,6)(F/P,i,8)B:F=A(P/A,i,5)(F/P,i,7)C:F=A(P/A,i,6)(F/P,i,2)D:F=A(P/A,i,5)(F/P,i,2)E:F=A(P/A,i,6)(F/P,i,1)

下列不正确的定义是()。A、int*p=i,i;B、int*p,i;C、inti,*p=i;D、inti,*p;