barriers / 阅读 / 详情

求2010年3月计算机二级C语言笔试复习资料

2023-07-08 00:13:44
共1条回复
北境漫步

  一、选择题(每题2分,共计70分)

  1.(1)下列数据结构中,属于非线性结构的是

  A)循环队列

  B)带链队列

  C)二叉树

  D)带链栈

  A B C D

  2.

  (2)下列数据结构中,能够按照“先进后出”原则存取数据的是

  A)循环队列

  B)栈

  C)队列

  D)二叉树

  A B C D

  3.

  (3)对于循环队列,下列叙述中正确的是

  A)队头指针是固定不变的

  B)队头指针一定大于队尾指针

  C)队头指针一定小于队尾指针

  D)队头指针可以大于队尾指针,也可以小于队尾指针

  A B C D

  4.

  (4)算法的空间复杂度是指

  A)算法在执行过程中所需要的计算机存储空间

  B)算法所处理的数据量

  C)算法程序中的语句或指令条数

  D)算法在执行过程中所需要的临时工作单元数

  A B C D

  5.

  (5)软件设计中划分模块的一个准则是

  A)低内聚低耦合

  B)高内聚低耦合

  C)低内聚高耦合

  D)高内聚高耦合

  A B C D

  6.

  (6)下列选项中不属于结构化程序设计原则的是

  A)可封装

  B)自顶向下

  C)模块化

  D)逐步求精

  A B C D

  7.(7)软件详细设计产生的图如下:

  该图是

  A)N-S图

  B)PAD图

  C)程序流程图

  D)E-R图

  A B C D

  8.

  (8)数据库管理系统是

  A)操作系统的一部分

  B)在操作系统支持下的系统软件

  C)一种编译系统

  D)一种操作系统

  A B C D

  9.

  (9)在E-R图中,用来表示实体联系的图形是

  A)椭圆形

  B)矩形

  C)菱形

  D)三角形

  A B C D

  10.(10)有三个关系R,S,和T如下:

  其中关系T由关系R和S通过某种操作得到,该操作为

  A)选择

  B)投影

  C)交

  D)并

  A B C D

  11.(11)以下叙述中正确的是

  A)程序设计的任务就是编写程序代码并上机调试

  B)程序设计的任务就是确定所用的数据结构

  C)程序设计的任务就是确定所用算法

  D)以上三种说法都不完整

  A B C D

  12.(12)以下选项中,能用作用户标识符的是

  A)void

  B)8_8

  C)_0_

  D)unsigned

  A B C D

  13.(13)阅读以下程序

  #include <stdio.h>

  main()

  { int case; float printF;

  printf("请输入2个数:");

  scanf("%d %f",&case,&printF);

  printf("%d %f ",case,printf);

  }

  该程序在编译时产生错误,其出错原因是

  A)定义语句出错,case是关键字,不能用作用户自定义标识符

  B)定义语句出错,printF不能用作用户自定义标识符

  C)定义语句无错,scanf不能作为输入函数使用

  D)定义语句无措,printf不能输出case的值

  A B C D

  14.(14)表达式:(int)((double)9/2)-(9)%2的值是

  A)0

  B)3

  C)4

  D)5

  A B C D

  15.(15)若有定义语句: int x=10;,则表达式x-=x+x的值为

  A)-20

  B)-10

  C)0

  D)10

  A B C D

  16.(16)有以下程序

  #include <stdio.h>

  main()

  { int a=1,b=0;

  printf("%d,",b=a+b);

  printf("%d",a=2*b);

  }

  程序运行后的输出结果是

  A)0,0

  B)1,0

  C)3,2

  D)1,2

  A B C D

  17.(17)设有定义: int a=1,b=2,c=3;,以下语句中执行效果与其它三个不同的是

  A)if(a>b) c=a,a=b,b=c;

  B)if(a>b){c=a,a=b,b=c;}

  C)if(a>b) c=a;a=b;b=c;

  D)if(a>b){c=a;a=b;b=c;}

  A B C D

  18.(18)有以下程序

  #include <stdio.h>

  main()

  { int c=0,k;

  for(k=1;k<3;k++)

  switch(k)

  { default:c+=k;

  case 2:c++;break;

  case 4:c+=2;break;

  }

  printf("%d ",c);

  }

  程序运行后的输出结果是

  A)3

  B)5

  C)7

  D)9

  A B C D

  19.(19)以下程序段中,与语句: k=a>b?(b>c?1:0):0;功能相同的是

  A)if((a>b)&&(b>c)) k=1;

  else k=0;

  B)if((a>b)||(b>c)) k=1;

  else k=0;

  C)if(a<=b)k=0;

  else if(b<=c) k=1;

  D) if(a>b) k=1;

  else if(b>c) k=1;

  else k=0;

  A B C D

  20.(20)有以下程序

  #include <stdio.h>

  main()

  { char s[]={"012xy"};int i,n=0;

  for(i=0;s[i]!=0;i++)

  if(s[i]>"a"&&s[i]<="z") n++;

  printf("%d ",n);

  }

  程序运行后的输出结果是

  A)0

  B)2

  C)3

  D)5

  A B C D

  21.

  (21)有以下程序

  #include <stdio.h>

  main()

  { int n=2,k=0;

  while(k++&&n++>2);

  printf("%d %d ",k,n);

  }

  程序运行后的输出结果是

  A)0 2

  B)1 3

  C)5 7

  D)1 2

  A B C D

  22.

  (22)有以下定义语句,编译时会出现编译错误的是

  A) char a="a";

  B) char a=" ";

  C) char a="aa";

  D) char a="x2d";

  A B C D

  23.

  (23)有以下程序

  #include <stdio.h>

  main()

  { char c1,c2;

  c1="A"+"8"-"4";

  c2="A"+"8"-"5";

  printf("%c,%d ",c1,c2);

  }

  已知字母A的ASCII码为65,程序运行后的输出结果是

  A)E,68

  B)D,69

  C)E,D

  D)输出无定值

  A B C D

  24.

  (24)有以下程序

  #include <stdio.h>

  void fun(int p)

  { int d=2;

  p=d++;

  printf("%d",p);

  }

  main()

  { int a=1;

  fun(a);

  printf("%d ",a);

  }

  程序运行后的输出结果是

  A)32

  B)12

  C)21

  D)22

  A B C D

  25.

  (25)以下函数findmax拟实现在数组中查找最大值并作为函数值返回,

  但程序中有错导致不能实现预定功能

  #define MIN -2147463647

  int findmax(int x[],int n)

  { int i,max;

  for(i=0;i<n;i++)

  { max=MIN;

  if(max<x[i]) max=x[i];

  }

  return max;

  }

  造成错误的原因是

  A)定义语句int i,max中max未赋值

  B)赋值语句max=MIN;中,不应该给max赋MIN值

  C)语句if(max<x[i]) max=x[i];中判断条件设置错误

  D)赋值语句max=MIN;放错了位置

  A B C D

  26.

  (26)有以下程序

  #include <stdio.h>

  main()

  { int m=1,n=2,*p=&m,*q=&n,*r;

  r=p;p=q;q=r;

  printf("%d,%d,%d,%d ",m,n,*p,*q);

  }

  程序运行后的输出结果是

  A)1,2,1,2

  B)1,2,2,1

  C)2,1,2,1

  D)2,1,1,2

  A B C D

  27.

  (27)若有定义语句: int a[4][10],*p,*q[4];且0<=i<4,则错误的赋值是

  A)p=a

  B)q[i]=a[i]

  C)p=a[i]

  D)p=&a[2][1]

  A B C D

  28.

  (28)有以下程序

  #include <stdio.h>

  #include <string.h>

  main()

  { char str[][20]={"One*World","One*Dream!"},*p=str[1];

  printf("%d,",strlen(p));

  printf("%s ",p);

  }

  程序运行后的输出结果是

  A)9,One*World

  B)9,One*Dream!

  C)10,One*Dream!

  D)10,One*World

  A B C D

  29.

  (29)有以下程序

  #include <stdio.h>

  main()

  { int a[]={2,3,5,4},i;

  for(i=0;i<4;i++)

  switch(i%2)

  { case 0:

  switch(a[i]%2)

  { case 0:a[i]++;break;

  case 1:a[i]--;

  } break;

  case 1:a[i]=0;

  }

  for(i=0;i<4;i++)

  printf("%d ",a[i]);

  printf(" ");

  }

  程序运行后的输出结果是

  A)3 3 4 4

  B)2 0 5 0

  C)3 0 4 0

  D)0 3 0 4

  A B C D

  30.

  (30)有以下程序

  #include <stdio.h>

  #include <string.h>

  main()

  { char a[10]="abcd";

  printf("%d,%d ",strlen(a),sizeof(a));

  }

  程序运行后的输出结果是

  A)7,4

  B)4,10

  C)8,8

  D)10,10

  A B C D

  31.

  (31)下面是有关C语言字符数组的描述,其中错误的是

  A)不可以用赋值语句给字符数组名赋字符串

  B)可以用输入语句把字符串整体输入给字符数组

  C)字符数组中的内容不一定是字符串

  D)字符数组只能存放字符串

  A B C D

  32.

  (32)下列函数的功能是

  fun(char *a,char *b)

  { while((*b=*a)!=""){a++;b++;} }

  A)将a所指字符串赋给b所指空间

  B)使指针b指向a所指字符串

  C)将a所指字符串和b所指字符串进行比较

  D)检查a和b所指字符串中是否有""

  A B C D

  33.

  (33)设有以下函数:

  void fun(int n,char *s){……}

  则下面对函数指针的定义和赋值均正确的是

  A)void (*pf)(); pf=fun;

  B)void *pf(); pf=fun;

  C)void *pf(); *pf=fun;

  D)void (*pf)(int,char);pf=&fun;

  A B C D

  34.(34)有以下程序

  #include <stdio.h>

  int f(int n);

  main()

  { int a=3,s;

  s=f(a);s=s+f(a);printf("%d ",s);

  }

  int f(int n)

  { static int a=1;

  n+=a++;

  return n;

  }

  程序运行后的输出结果是

  A)7

  B)8

  C)9

  D)10

  A B C D

  35.

  (35)有以下程序

  #include <stdio.h>

  #define f(x) x*x*x

  main()

  { int a=3,s,t;

  s=f(a+1);t=f((a+1));

  printf("%d,%d ",s,t);

  }

  程序运行后的输出结果是

  A)10,64

  B)10,10

  C)64,10

  D)64,64

  A B C D

  36.

  (36)下面结构体的定义语句中,错误的是

  A)struct ord {int x;int y;int z;};struct ord a;

  B)struct ord {int x;int y;int z;} struct ord a;

  C)struct ord {int x;int y;int z;} n;

  D)struct {int x;int y;int z;} a;

  A B C D

  37.(37)设有定义: char *c;以下选项中能够使字符型指针C正确指向一个字符串的是

  A) char str[]="string";c=str;

  B) scanf("%s",c);

  C) c=getchar();

  D) *c="string";

  A B C D

  38.

  (38)有以下程序

  #include <stdio.h>

  #include <string.h>

  struct A

  { int a;char b[10];double c;};

  struct A f(struct A t);

  main()

  { struct A a={1001,"ZhangDa",1098.0};

  a=f(a); printf("%d,%s,%6.1f ",a.a,a.b,a.c);

  }

  struct A f(struct A t)

  { t.a=1002;strcpy(t.b,"ChangRong");t.c=1202.0;return t;}

  程序运行后的输出结果是

  A)1001,ZhangDa,1098.0

  B)1002,ZhangDa,1202.0

  C)1001,ChangRong,1098.0

  D)1002,ChangRong,1202.0

  A B C D

  39.

  (39)有以下程序

  int r=8;

  printf("%d ",r>>1);

  输出结果是

  A)16

  B)8

  C)4

  D)2

  A B C D

  40.

  (40)下列关于C语言文件的叙述中正确的是

  A)文件由一系列数据一次排列组成,只能构成二进制文件

  B)文件由结构序列组成,可以构成二进制文件或文本文件

  C)文件由数据序列组成,可以构成二进制文件或文本文件

  D)文件由字符序列组成,只能是文本文件

  A B C D

  二、填空题(每空2分,共计30分)

  1.(1)某二叉树有5个度为2的结点以及3个度为1的结点,则该二叉树中共有【1】个结点。

  输入答案,中间不含空格:

  2.

  (2)程序流程图中菱形框表示的是【2】

  输入答案,中间不含空格:

  3.

  (3)软件开发过程主要分为需求分析、设计、编码与测试四个阶段。其中【3】阶段

  产生”软件需求规格说明书“。

  输入答案,中间不含空格:

  4.

  (4)在数据库技术中,实体集之间的联系可以是一对一或一对多或多对多的,那么”学生“

  和"可选课程"的联系为【4】

  输入答案,中间不含空格:

  5.

  (5)人员基本信息一般包括:身份证号,姓名,性别,年龄等。其中可以作为主关键字的

  是【5】

  输入答案,中间不含空格:

  6.

  (6)若有定义语句:int a=5;,则表达式a++的值是【6】。

  输入答案,中间不含空格:

  7.

  (7)若有语句double x=17;int y;,当执行y=(int)(x/5)%2;之后y的值是【7】

  输入答案,中间不含空格:

  8.

  (8)以下程序运行后的输出结果是【8】

  #include <stdio.h>

  main()

  { int x=20;

  printf("%d ",0<x<20);

  printf("%d ",0<x&&x<20);

  }

  输入答案,中间不含空格:

  9.

  (9)以下程序运行后的输出结果是【9】

  #include <stdio.h>

  main()

  { int a=1,b=7;

  do{

  b=b/2;a+=b;

  } while (b>1);

  printf("%d ",a);

  }

  输入答案,中间不含空格:

  10.

  (10)有一下程序

  #include <stdio.h>

  main()

  { int f,f1,f2,i;

  f1=0;f2=1;

  printf("%d %d ",f1,f2);

  for(i=3;i<=5;i++)

  { f=f1+f2; printf("%d",f);

  f1=f2; f2=f;

  }

  printf(" ");

  }

  程序运行后的输出结果是【10】

  输入答案,中间不含空格:

  11.

  (11)有以下程序

  #include <stdio.h>

  int a=5;

  void fun(int b)

  { int a=10;

  a+=b; printf("%d",a);

  }

  main()

  { int c=20;

  fun(c); a+=c; printf("%d ",a);

  }

  程序运行后的输出结果是【11】

  输入答案,中间不含空格:

  12.

  (12)设有定义

  struct person

  { int ID;char name[12];} p;

  请将scanf("%d",【12】);语句补充完整,使其能够为结构体变量p的

  成员ID正确读入数据。

  输入答案,中间不含空格:

  13.

  (13)有以下程序

  #include <stdio.h>

  main()

  { char a[20]="How are you?",b[20];

  scanf("%s",b); printf("%s %s ",a,b);

  }

  程序运行时从键盘输入: How are you?<回车>

  则输出结果为【13】

  输入答案,中间不含空格:

  14.

  (14)有以下程序

  #include <stdio.h>

  typedef struct

  { int num;double s;} REC;

  void fun1(REC x){ x.num=23;x.s=88.5; }

  main()

  { REC a={16,90.0};

  fun1(a);

  printf("%d ",a.num);

  }

  输入答案,中间不含空格:

  15.

  (15)有以下程序

  #include <stdio.h>

  fun(int x)

  { if(x/2>0) fun(x/2);

  printf("%d ",x);

  }

  main()

  { fun(6);printf(" ");}

  程序运行后的输出结果是【15】

  输入答案,中间不含空格:

相关推荐

服务器server0处于不兼容的状态怎么办

控制台启动server时报"对于服务器server-1与计算机machin对于服务器AdminServer, 与计算机Machine-0相关联的节点管理器无法访问。所有所选服务器当前都处于与此操作不兼容的状态, 或未与运行的节点管理器关联, 或没有授权您执行请求的操作。不会执行任何操作次错误基本都遇到过。在网上搜了半天,最后才解决,基本如下:对于服务器server-1与计算机machine-2相关联的节点管理器无法访问。所有所选服务器当前都处于与此操作不兼容的状态, 或未与运行的节点管理器关联, 或没有授权您执行请求的操作。不会执行任何操作。原因:nodemanager没有启起来一、对于managedServer于adminServer在同一服务器上的情况:1、在控制台可查看该机器的节点管理器端口,比如为55562、用netstat -nap | grep 5556命令查看端口为5556的进程是否存在便知nodemanager是否已启动,这时肯定是不存在的3、但是用ps -ef |grep java命令查看进程,可看到NodeManager进程4、用kill -9 NodeManager进程号5、vi /etc/hosts查看ip地址配置是否正确6、vi /etc/sysconfig/network查看机器名配置是否正确7、vi $WL_HOME/common/nodemanager/nodemanager.properties查看以下配置是否正确,这里的端口5556就与上文提到的端口一致,如果端口不对可能是因为在前一次nodemanager起来之后,在控制台修改了端口,而在nodemanager.properties文件中保存的还是原端口,所以当再次启动nodemanager时,启动的端口不是修改后的而是原来的。ListenPort=5556SecureListener=falseStartScriptEnabled=true二、如果AdminServer在服务器A上,ManagedServer在服务器B上的情况:这时候不能启动nodemanager还可能是因为服务器B无法与服务器A通讯,这时候会报socket相关错误。此时,1、在B服务器上修改$WL_HOME/common/nodemanager/nodemanager.properties文件:SecureListener=falseStartScriptEnabled=true2、在B上$WL_HOME/common/bin/目录下执行wlst.sh脚本./wlst.sh即可3、执行完2后会来到wls:/offline>下,在此输入connect()回车4、此时会依次要求输入AdminServer的用户名、密码及url如下Please enter your username [weblogic] :weblogicPlease enter your password [weblogic] :Please enter your server URL [t3://localhost:7001] :t3://adminServerIP:port以上三项指服务器A上登录控制台时的用户名、密码及IP地址和端口5、如果第4步执行成功,则显示Successfully connected to Admin Server "AdminServer" that belongs to domain "my_domain".会跳到wls:/my_domain/serverConfig>my_damain指服务器A上的domain如果第4步执行不成功,会返回第3步重新输入connect()此时也可输入dumpStack()回车,查看具体错误6、第5步执行成功后,在wls:/my_domain/serverConfig>下依次执行nmEnroll("/home/weblogic/Oracle/Middleware/wlserver_10.3/common/nodemanager")nmEnroll("/home/weblogic/Oracle/Middleware/user_projects/domains/server_b_domain")这里的weblogic目录指服务器B上的weblogic目录,视自己的目录修改语句。7、注册成功后,按ctrl+c返回weblogic目录,再到$WL_HOME/servers/bin目录下nohup ./startNodeManager.sh &启动nodemanager如果启动时报以下错误严重: Fatal error in node manager serverjava.net.BindException: Address already in useat java.net.PlainSocketImpl.socketBind(Native Method)at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:365)at java.net.ServerSocket.bind(ServerSocket.java:319)at java.net.ServerSocket.(ServerSocket.java:185)at weblogic.nodemanager.server.Listener.init(Listener.java:54)at weblogic.nodemanager.server.NMServer.start(NMServer.java:205)at weblogic.nodemanager.server.NMServer.main(NMServer.java:355)at weblogic.NodeManager.main(NodeManager.java:31)说明前面以执行过该语句,此时需要杀掉nodemanager的进程号再次执行启动语句。补充:节点管理器类型可选择"普通"。
2023-07-07 20:47:173

System.UnauthorizedAccessException

你上传后的图片展示应该用上传后的网络路径,比如:"http://www.yourdamain.com/photo/20100120091326.jpg",而不是用"E:webjob0231personpersonPhoto20100120091326.jpg"这样的本地路径。因为在网络应用程序对本地图片没有访问权限。 -----------------------------------------------------------当你保存的时候,相当于服务端的内部逻辑,所以用FileUpload1.PostedFile.SaveAs(Server.MapPath("../person/personPhoto/" + filename));是没错的。但当从客户端打开网络应用程序时,调用的路径是相对于客户端的,比如"E:webjob0231personpersonPhoto20100120091326.jpg",这被认为是客户端的路径,和你直接在浏览器上键入这个地址是一样的效果,打开的是本地文件而不是服务端文件。所以在面向客户端的时候,比如展示图片,必须用网络路径。
2023-07-07 20:47:371

汇编语言的HIGH和LOW指令怎么用

DA1是你定义的变量,变量是不可以用HIGH和LOW操作的!
2023-07-07 20:47:453

Is That You? 歌词

歌曲名:Is That You?歌手:Bill Frisell专辑:Is That You?Bow Wow - Is That You (P.Y.T)Im Looking for thatpretty young thangup in the spot, looking hot playin` no gamesAnd she steady tryina get it crunk right from the jumpand she playin` no games.that you Shawty? (yea thats me)Did you come here to party? (Yes indeed)Ha But could you drop it down lowwhen its time to get lowif so baby girl lets go.(Come and get it boy)They say I act old, but I got that old man gameCause I stay tryina find me a pretty young thangthat I call anytime if she ready to hangand if sun"it jump off she be ready to bangI like `em fresh outta high schooljust about to graduate short shirtsed`day tryina show they little shapelow cut jump jeans lugz on hea feetneighborhood girl but she love the streetsIn a party she da main one doin dat right thurrEv"time hea jam drop hands up in the airr.And she aint thinkin you, she aint thinkin bout hea hurrAnd if you ballin homie she dont even really currShe got her mind set on what she wanna doAnd she aint come alone she got her whole little crew.Her P.Y.T"s that"ll make ya head spinEry nigga in the club tryina get inIm Looking for thatpretty young thangup in the spot, looking hot playin` no gamesAnd she steady tryina get it crunk right from the jumpand she playin` no games.that you Shawty? (yea thats me)Did you come here to party? (Yes indeed)Ha But could you drop it down lowwhen its time to get lowif so baby girl lets go.(Come and get it boy)They got a whole lot of attituderap is all that they listen tostays in the sweet tryina find somthin newcustom ipods with the rhinestonesnextel camara phones with all the hot ringtones.Light skin til black little PYT"sboricua mami"s that like to eat Mickey D"salways into sumthin like NWAgota little bittie frame but home she dont playYou know a gyrl is the reason that a nigga wanna stuntAnd im weak for em homie I aint even gon frontSee most young nigga"s like em oldernot me spot they spot me like in the summerI run up hit them with that Moss A gamelike "Baby wuz ya phone numba? Were ya live at?Shawdy what part of town? Cuz I just wanna be down!"Im Looking for thatpretty young thangup in the spot, looking hot playin` no gamesAnd she steady tryina get it crunk right from the jumpand she playin` no games.that you Shawty? (yea thats me)Did you come here to party? (Yes indeed)Ha But could you drop it down lowwhen its time to get lowif so baby girl lets go.(Come and get it boy)Pretty Young Thang repeat after mesay Nah nanana "Nah nanana"Nah nanana "Nah nanana"say pretty young thangs repeat after mesay Nah nanana "Nah nanana"Nah nanana "Nah nanana"Im Looking for thatpretty young thangup in the spot, looking hot playin` no gamesAnd she steady tryina get it crunk right from the jumpand she playin` no games.that you Shawty? (yea thats me)Did you come here to party? (Yes indeed)Ha But could you drop it down lowwhen its time to get lowif so baby girl lets go.(Come and get it boy)http://music.baidu.com/song/1061230
2023-07-07 20:47:521

c语言输入一串字母 输出字母数字 其它字符的个数

对于这个问题,不需要存到数组。按照如下流程即可:1 输入一个字符,对该字符进行判断:a) 如果是数字,则数字累加器加一。b) 如果是字母,则字母累加器加一。c)如果是换行,则结束统计(以换行为结束符。如需其他结束符,根据需要更改判断)。2输出结果。代码:#include <stdio.h>int main(){int c, n, i;c=n=0;while(1){i = getchar();if(i>="0" && i <= "9") n++;else if((i>="a" && i <= "z")||(i>="A" && i <= "Z"))c++;else if(c==" ") break;}printf("数字%d个,字母%d个 ", n,c);return 0;}
2023-07-07 20:48:021

题目如下 #includestruct s {int a,b;} data[2]=10,100,20,200}; main() { struct s p=da...

struct s {int a,b;} data[2]={10,100,20,200}; 定义了一个数组,data[1]中的a未20b为200然后p=a[1],把a[1]的值赋给p
2023-07-07 20:48:092

C语言编程代码

#include<stdio.h>int main(){ int date=0,da=0,xiao=0; char c; c=getchar(); while(c!="!") { if(c>="a"&&c<="z") xiao++; if(c>="A"&&c<="Z") da++; if(c>="0" &&c<="9") date++; c=getchar(); // 输入多个字符} printf("xiao=%d,da=%d,date=%d ",xiao,da,date); return 0;}
2023-07-07 20:48:205

数据集合处理(c++处理)

/*要求:1.集合元素不超过100个。2.集合用数组表示(数组预先定义大一些)。功能有:1.程序初始运行时任意输入一批初始数放入集合(可少可多,不少于5个,不超过30个)。2对该批数排序存放。程序完成前两步后,通过循环可以不断选择下面的某项功能执行(用提示语句列出菜单,通过读入某变量值,switch判断该变量,如接受到1表示执行第一项,依次类推,某项功能执行完可以返回菜单,也可退出系统):3.任意插入一个数到排好序的集合中,保持集合依然有序。4.在集合中删除一个元素。5.查询某个值是否在集合中(该数由键盘输入)。6.求出该数据集合的最大值和最小值及所在位置。7.找出数据集合中的所有素数。*/#include<iostream.h>#include<windows.h>/*charmenu[][100]={" **************************************","请选择操作:","1:输出现有数据;","2:插入一个数据;","3:删除一个数据;","4:查找指定数据;","5:找出数组中最大值","6:找出数组中最小值;","0:退出","*************************************** "};*/charmenu[]=" *************************************** 请选择操作: 1:输出现有数据; 2:插入一个数据; 3:删除一个数据; 4:查找指定数据; 5:找出数组中最大值; 6:找出数组中最小值; 0:退出。 *************************************** ";classArry{private:intarry[110];intnum;public:Arry();//用随机产生的数初始化数组并排序voidInsert(intia);//插入一个数voidShow();//输出现有数组voidDelete(intda);//删除指定的数voidFind(intfa);//查找指定的数voidFindMax();//找出最大数voidFindMin();//找出最小数};Arry::Arry(){num=30;inttemp=0;for(inti=0;i<110;i++)if(i<30)arry[i]=rand()/100;elsearry[i]=0;for(i=0;i<num-1;i++)for(intj=0;j<num-i-1;j++)if(arry[j]>arry[j+1]){temp=arry[j];arry[j]=arry[j+1];arry[j+1]=temp;}}voidArry::Insert(intia){inti=0;if(arry[0]>=ia){for(intj=num;j>0;j--)arry[j]=arry[j-1];arry[0]=ia;num++;}else{while(arry[i]<ia&&i<num)i++;for(intj=num;j>i;j--)arry[j]=arry[j-1];arry[j]=ia;num++;}}voidArry::Show(){cout<<"现有数据为: ";for(inti=0;i<num;i++){cout<<arry[i]<<" ";if((i+1)%5==0)cout<<endl;}cout<<endl;}voidArry::Find(intfa){intf=0;for(inti=0;i<num;i++)if(arry[i]==fa){f=1;cout<<"数组中第"<<i+1<<"个数是";cout<<arry[i]<<endl;}if(f==0)cout<<"数组中没有找到指定的数!"<<endl;}voidArry::Delete(intda){ints=0;for(inti=0;i<num;i++)if(arry[i]==da){for(intj=i;j<num-1;j++)arry[j]=arry[j+1];arry[j]=0;i--;num--;s++;}if(s)cout<<"删除了"<<s<<"个数据!"<<endl;elsecout<<"数组中没有找到指定的数!"<<endl;}voidArry::FindMax(){intp=0;intmax=arry[0];for(inti=1;i<num;i++)if(arry[i]>=max){max=arry[i];p=i;}cout<<"数组中最大数据是:"<<max<<endl;cout<<"在数组中的位置是第"<<p+1<<"个"<<endl;}voidArry::FindMin(){intp=0;intmin=arry[0];for(inti=1;i<num;i++)if(arry[i]<=min){min=arry[i];p=i;}cout<<"数组中最小数据是:"<<min<<endl;cout<<"在数组中的位置是第"<<p+1<<"个"<<endl;}voidmain(){Arrya;intchoice=0;intdata=0;while(1){//for(inti=0;i<10;i++)//cout<<menu[i]<<endl;cout<<menu;cin>>choice;switch(choice){case0:exit(1);break;case1:a.Show();break;case2:cout<<"输入要插入的数据:";cin>>data;a.Insert(data);break;case3:cout<<"输入要删除的数据:";cin>>data;a.Delete(data);break;case4:cout<<"输入要查找的数据:";cin>>data;a.Find(data);break;case5:a.FindMax();break;case6:a.FindMin();break;default:cout<<"操作错误! ";break;}}}
2023-07-07 20:48:373

c语言:输入十个数,求最大值,最小值,平均值

以下是一个简单的 C 语言程序,可以用于输入十个数,并求出它们的最大值、最小值和平均值:```c#include <stdio.h>int main() { int i; double sum = 0.0, max, min, num; // 输入第一个数,并将其作为最大值和最小值的初始值 printf("请输入第1个数: "); scanf("%lf", &num); max = min = num; sum += num; // 循环输入剩余9个数,并更新最大值、最小值和总和 for (i = 2; i <= 10; i++) { printf("请输入第%d个数: ", i); scanf("%lf", &num); if (num > max) { max = num; } if (num < min) { min = num; } sum += num; } // 输出结果 printf("最大值为: %.2f ", max); printf("最小值为: %.2f ", min); printf("平均值为: %.2f ", sum / 10); return 0;}```在这个程序中,我们使用了一个 `for` 循环来输入十个数,并分别更新最大值、最小值和总和。需要注意的是,我们在循环开始时已经输入了第一个数,并将其作为最大值和最小值的初始值。最后,我们输出计算得到的最大值、最小值和平均值。需要注意的是,在计算平均值时,我们使用了总和除以10的方式来求解,因为本程序中输入了恰好十个数。如果输入的数目不是十个,应该相应地调整计算平均值的方式。
2023-07-07 20:48:473

程序运行中da变量精度不够,后面总是0.0000

没什么问题啊,除了 第7行 // int ;
2023-07-07 20:49:072

编写函数求出二维整型数组中元素的最大值及其下标号。

//你的错误太多,给你个新的#include<stdio.h>#include<stdlib.h>void da(int a[][4],int n){int i,j,row=0,col=0,max=a[0][0];for(i=0;i<n;i++)for(j=0;j<4;j++){if(a[i][j]>max){max=a[i][j];row=i;col=j;}}printf("最大值:a[%d][%d]=%d ",row,col,max); }int main(){int i,j,n,a[10][4];scanf("%d",&n);for(i=0;i<n;i++)for(j=0;j<4;j++)scanf("%d",&a[i][j]);da(a,n);return 0; }
2023-07-07 20:49:173

单片机汇编程序实现DA转换,用DAC0832芯片实现

这是一个仿真实例,可以参考一下,试试。
2023-07-07 20:49:383

关于单片机DA指令

正确答案,可见:http://zhidao.baidu.com/question/151649564
2023-07-07 20:49:462

51低端单片机没有PWM,怎么用DA做呼吸灯???

AD呼吸灯是什么?如果需要51输出PWM的话可以使用定时器,里89C52为例推荐是定时器T2作为发生器,可以作为ADC0809这样AD的工作频率
2023-07-07 20:49:542

我想知道单片机的蜂鸣器音乐程序中断是如何响应的?从main主程序中如何到中断程序?具体步骤是啥?谢谢!

挺简单啊,时间一到就进入中断,中断完再回到主程序
2023-07-07 20:50:032

C++实现:6.编写程序,统计文本文件中大写英文字母,小写英文字母和数字的个数。

#include<stdio.h>#include<stdlib.h>#define NULL 0void main(){FILE *fp1=NULL,*fp2=NULL;int xiao=0,da=0,shu=0,all[26],i;char ch;fp1=fopen("你要读取的文本名字.txt","r");//要把你要读取的文本放在程序所在的地方fp2=fopen("你想要保存位的文本的名字.txt","w");if(fp1==NULL) { printf("Can not open "); exit(0); }if(fp2==NULL) { printf("Can not open "); exit(0); }for(i=0;i<26;i++) all[i]=0;ch=fgetc(fp1);while(ch!=EOF) { if((ch>=65)&&(ch<=90)) { da++; all[ch-65]++; } else if((ch>=97)&&(ch<=122)) { xiao++; all[ch-97]++; } else if((ch>=48)&&(ch<=57)) { shu++; } ch=fgetc(fp1); }printf("小写字母个数为%d 大写字母个数为%d 数字个数为%d ",xiao,da,shu);fprintf(fp2,"小写字母个数为%d 大写字母个数为%d 数字个数为%d ",xiao,da,shu);for(i=0;i<26;i++)fprintf(fp2,"%c=%d ",i+65,all[i]);fclose(fp1);fclose(fp2);}vc++6.0运行成功
2023-07-07 20:50:112

有一首女生唱的英文歌,中间停顿部分是啦啦啦 啦啦啦啦啦啦啦,哼了很长一段,整首歌节奏感很强,求歌名

霹雳英雄布袋戏、不谢
2023-07-07 20:50:1914

编写程序,输入一维数组的10个元素,并将最小值与第1个数交换,最大值与最后一个数交换,然后输出交换后的1

#include<stdio.h>void main(){ int i,max,min,da,xiao,a[10]; printf("请输入任意10个整数 "); for(i=0;i<10;i++) { scanf("%d",&a[i]); } max=a[0]; min=a[0]; for(i=1;i<10;i++) { if(a[i]>max) { max=a[i]; da=i;} if(a[i]<min){ min=a[i]; xiao=i;} } a[da]=a[0]; a[xiao]=a[9]; a[0]=max; a[9]=min; for(i=0;i<10;i++) printf("%d ",a[i]);}
2023-07-07 20:51:032

c++数组复制的函数

#include<iostream>#define max 100using namespace std;class bank{ int top; char date[max][10]; float money[max]; float rest[max]; static float sum;public: bank(){top=0;} void bankin(char d[],float m) { // 数组的名称即可作为指针使用 strcpy(date[top],d); money[top]=m; sum=m+sum; rest[top]=sum; top++; } void bankout(char d[],float m) { strcpy(date[top],d); money[top]=-m; sum=sum-m; rest[top]=sum; top++; } void disp() { int i; printf(" 日期 存入 取出 余额 "); for(i=0;i<top;i++) { printf("%8s ",date[i]); if(money[i]<0) printf("%6f ",-money[i]); else printf("%f ",money[i]); printf("%6d ",rest[i]); } }};float bank::sum=0;void main(){ bank obj; obj.bankin("2002.2.5",1000); obj.bankin("2001.3.2",2000); obj.bankout("2001.4.1",500); obj.bankout("2001.4.5",800); obj.disp();}
2023-07-07 20:51:149

c++程序编写问题2

h> void fun(int a[][34],int n) { int i,j; for(i=0;i<n;i++) for(j=0;j<=i;j++) { if(i==j) a[i][j]=1; else if(j==0) a[i][j]=1; else a[i][j]=a[i-1][j-1]+a[i-1][j]; } } int main() { int i,j,k,n; int a[34][34]; k=1; while(scanf("%d",&n)==1) // 输入你要显示的行数,如1,2,3,4,... { fun(a,n); printf("Case %d: ",k++); for(i=0;i<n;i++) { for (j = 0; j < n - i; j ++) printf(" "); for(j=0;j<=i;j++) { if(j==i) printf("%d",a[i][j]); else printf("%d ",a[i][j]); } printf(" "); } printf(" "); } return 0; }第2个:#include<stdio.h>struct d{ int year; int month; int day;}data;int main(){ int m(struct d da); int n; printf("输入日期:"); scanf("%d%d%d",&data.year,&data.month,&data.day); n=m(data); printf("该日期是%d年第%d天",data.year,n); return 0;}int m(struct d da){ if(da.month==1) return da.day; int i,sum=0,mo[12]=; for(i=0;i<da.month-1;i++) { sum=sum+mo[i]; } sum+=da.day; if(da.year%400==0||da.year%4==0&&da.year%100!=0) if(da.month>2) sum++; return sum;}
2023-07-07 20:51:311

采用表尾插入元素创建一个单链表。

#include<iostream> using namespace std; template <typename T>class List;template <typename T>class Node { friend class List<T>;private: T data; Node<T>* next;public: Node(){data=NULL;next=NULL;} Node(T& da) {data =da;next=NULL;} Node(T& da,Node<T>* ne) {data=da;next = ne};};template <typename T>class List{private: int length; Node<T>* head;//头结点,其next节点为第一个节点 Node<T>* last;//指向最后一个结点的指针public: List(); void insert (T& data); void remove (T data); int getLength() const{return length;}; void print () const; void reverse();};template <typename T>List<T>::List(){ length = 0; head = new Node<T>(); last = head;}template <typename T>void List<T>::insert(T &data){ last = last ->next =new Node<T>(data); length++;}template <typename T>void List<T>::remove(T data){ Node<T>* current = head; while (current->next!=NULL) { if(current->next->data==data) { Node<T>* temp = current->next; current->next = current->next->next; delete temp; length--; } else current = current->next; }}template <typename T>void List<T>::print() const{ Node<T>* current =head; while (current->next!=NULL) { current = current->next; cout<<current->data<<" "; }}template <typename T>void List<T>::reverse(){ Node<T>* temp1;//利用三个临时指针降List中每个结点的next倒向 Node<T>* temp2; Node<T>* temp3; last = head->next; temp1 = head; temp2 = temp1->next; while(temp2!=NULL) { temp3 = temp2->next; temp2->next = temp1; temp1 = temp2; temp2 = temp3; }//倒向完毕 last->next = NULL;//重新设置head和last head->next = temp1;}int main ()//测试代码{ List<int> one; int i1=34,i2=89,i3=232; one.insert(i1); one.insert(i1); one.insert(i1); one.insert(i1); one.insert(i2); one.insert(i3); one.print(); cout<<endl; one.reverse(); one.print(); cout<<endl; one.remove(34); one.print();}我用的是vc2008,应该没问题,都按照要求了
2023-07-07 20:51:393

c语言,一个简单问题,求教

#include <stdio.h>#include <stdlib.h>#include <string.h>struct A{ int a; char b[10]; double c;};struct A f(struct A t);void main(){ struct A a = {1001,"ZhangDa",1098.0}; a = f(a); printf("%d,%s,%6.1f ",a.a,a.b,a.c);}struct A f(struct A t){ t.a=1002; strcpy(t.b,"ChangRong"); t.c=1202.0; return t;}
2023-07-07 20:51:488

C++实现一个Date类 用日/月/年的格式输出日期,设置日期操作;在Date类基础上,实现一个可以进行加天数操作

#include<iostream.h>static int dys[]={31,28,31,30,31,30,31,31,30,31,30,31};class date{ int yr,mo,da;public: date(int y,int m,int d) { yr=y; mo=m; da=d; } date() {} void disp() { cout<<yr<<"年"<<mo<<"月"<<da<<"日"<<endl; } date operator + (int day) { date dt=*this; day+=dt.da; while (day>dys[dt.mo-1]) { day-=dys[dt.mo-1]; dt.mo++; if (dt.mo==13) { dt.mo==1; dt.yr++; } } dt.da=day; return dt; }};void main(){ int y,m,d,a,b; cout<<"输入年月日:"; cin>>y>>m>>d; date d1(y,m,d),d2,d3; d1.disp(); cout<<"输入要加的天数(整数):"; cin>>a; d2=d1+a; d2.disp();}
2023-07-07 20:52:051

The main streets _____ shining in the sun. A.seemed B.are seemed C.are seeming D.has seemed 选哪个

Aseem不用于进行时态和被动语态中
2023-07-07 20:52:123

c语言编程单片机与proteus仿真问题(DA转换)?

双击led,在mode type的属性里调成digital
2023-07-07 20:52:223

#include "stdio.h" main() { int x=8; for(;x>0;x--) { if(x%3) {printf(%d,,x--}

#include <stdio.h>void main() { int x=8; for(;x>0;x--) { if(x%3) { printf("%d ",x--); } }}不知道你说什么意思,帮你完整了下
2023-07-07 20:52:432

在函数中为啥使用结构体指针数组,为其赋值赋不上,(申请了空间),在main函数中可以赋值

你的空间没释放!!free(s);free(root);
2023-07-07 20:53:012

123.有以下程序 #include main() { int a=0,b=0,c=0,d=0; (a++ && b++) ? c++ : d++; printf(

首先,判断(a++&&b++)这个条件,这个条件中又首先判断a++,得到结果为假(由于是后置自增运算符,所以a在判断的时候为0,判断之后为1)。&&运算中,只要有一个条件为假,则整个条件为假,所以程序不再判断b++这个条件,并且将(a++&&b++)这个条件判定为假。所以程序执行冒号后面的d++。所以a=1,b=0,c=0,d=1。所以答案选D
2023-07-07 20:53:101

二级C++考试复习习题集

应付考试,首选谭浩强的书啦~
2023-07-07 20:53:192

c语言问题

若有高手,望详细解答,小弟也很小知道,谢谢
2023-07-07 20:53:293

关于C语言中的while(1)的应用对程序执行的影响

不加while(1)则程序会不停地循环执行整个main()函数,加了的话就会停在while(1)处了。
2023-07-07 20:53:382

C语言编写一万年历系统!高分!

你是沈师软件大一的吧???TC 2.0 /* welcome to use the WanNianLi system! Copyright @ 2005 KongXinCai All rights reserved!:):):)*/ #include<stdio.h> #include<stdlib.h> char* month_str[]={"January","February","March","April","May","June","July","August","September","October","November","December"}; char* week[]={"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"}; int IsLeapYear(int year) /*find out the year is leap year or not*/ { if((year%4==0&&year%100!=0)||(year%400==0)) return 1; else return 0; } int month_day(int year,int month) { int mon_day[]={31,28,31,30,31,30,31,31,30,31,30,31}; if(IsLeapYear(year)&&month==2) return 29; else return(mon_day[month-1]); } int DaySearch(int year,int month,int day) /*search what day this day is*/ { int c=0; float s; int m; for(m=1;m<month;m++) c=c+month_day(year,m); c=c+day; s=year-1+(float)(year-1)/4+(float)(year-1)/100+(float)(year-1)/400-40+c; return ((int)s%7); } int PrintAllYear(int year)/*print the all year*/ { int temp; int i,j; printf(" %d Calander ",year); for(i=1;i<=12;i++) { printf(" %s(%d) ",month_str[i-1],i); printf("0 1 2 3 4 5 6 "); printf("S M T W T F S "); temp=DaySearch(year,i,1); for(j=1;j<=month_day(year,i)+temp;j++) { if(j-temp<=0) printf(" "); else if(j-temp<10) printf("%d ",j-temp); else printf("%d ",j-temp); if(j%7==0) printf(" "); } } return 0; } int main() { int option,da; char ch; int year,month,day; printf("Copyright @ 2005 TianQian All rights reserved!:):):)"); printf(" Welcome to use the WanNianLi system! "); while(1) { printf(" Please select the service you need: "); printf(" 1 Search what day the day is"); printf(" 2 Search whether the year is leap year or not"); printf(" 3 Print the calander of the whole year"); printf(" 4 Exit "); scanf("%d",&option); switch(option) { case 1: while(1) { printf(" Please input the year,month and day(XXXX,XX,XX):"); scanf("%d,%d,%d,%c",&year,&month,&day); da=DaySearch(year,month,day); printf(" %d-%d-%d is %s,do you want to continue?(Y/N)",year,month,day,week[da]); fflush(stdin); scanf("%c",&ch); if(ch=="N"||ch=="n") break; } break; case 2: while(1) { printf(" Please input the year which needs searched?(XXXX)"); scanf("%d",&year); if(IsLeapYear(year)) printf(" %d is Leap year,do you want to continue?(Y/N)",year); else printf(" %d is not Leap year,do you want to continue(Y/N)?",year); fflush(stdin); scanf("%c",&ch); if(ch=="N"||ch=="n") break; } break; case 3: while(1) { printf(" Please input the year which needs printed(XXXX)"); scanf("%d",&year); PrintAllYear(year); printf(" Do you want to continue to print(Y/N)?"); fflush(stdin); scanf("%c",&ch); if(ch=="N"||ch=="n") break; } break; case 4: fflush(stdin); printf("Are you sure?(Y/N)"); scanf("%c",&ch); if(ch=="Y"||ch=="y") exit(0); break; default: printf(" Error:Sorry,there is no this service now! "); break; } } return 0; }
2023-07-07 20:53:481

c语言 求数列中最大值和最小值得差

先排序,再求差
2023-07-07 20:53:585

c语言中函数返回值是指向一维数组的指针的函数怎么写?

typedef double (*point) [2]; point read(int n); 这样如何?
2023-07-07 20:54:163

以下叙述中正确的是a一个c源程序可由一个或多个函数组成b在c程序中注释说明只

以下叙述不正确的是()x0dA:一个C程序可由一个或多个main函数组成x0dB:一个C源程序必须包含一个main函数x0dC:C程序的基本组成单位是函数x0dD:在C程序中,注释说明只能位于一条语句的后面5
2023-07-07 20:54:251

用C语言制作万年历

要DOS下的图形界面的???C++/C#可以不?C太麻烦了 懒得写
2023-07-07 20:54:333

java怎么添加main方法?

public static void main(string[] args){}
2023-07-07 20:54:523

C语言编程 求1 -3 5 -7 9 ....前20项和

#include <stdio.h>#include <stdlib.h>int main(){ int n,sum,i; sum=0; for(i=0; i<20; i++) { n=1+i*2; if(i%2== 1) n=-n; sum+=n; } printf("result:%d",sum); return 0;}
2023-07-07 20:55:023

单片机DA转换产生三角波的c语言程序

你好!你选的那个DA芯片?,是做实物还是仿真就行?
2023-07-07 20:55:111

c语言程序问题

input函数中,需要改为char a[10][80];int i;
2023-07-07 20:55:214

C程序:输入若干字符,分别统计数字字符的个数、英文字母的个数,当输入换行符时输出统计结果,运行结束。

输入用gets,然后分别判断各字符在"0"-"9"之间,还是在"a"-"z"或"A"-"Z"之间
2023-07-07 20:55:302

老师出的turbo C语言设计题目。题目如下,跪求大神帮我打下源代码。参考。

现在不动手,将来想做这一行,还是要动手,自己动动手吧,也不难。
2023-07-07 20:55:361

C语言a,b,c三者间比较大小,程序

写一个程序即可。程序详情:#include "stdio.h"main(){int a,b,c;scanf("%d%d%d",&a,&b,&c);if(a>b&&a>c){if(b>c) printf("%d,%d,%d",a,b,c);else printf("%d,%d,%d",a,c,b);}if(b>c&&b>a){if(a>c) printf("%d,%d,%d",b,a,c);else printf("%d,%d,%d",b,c,a);}if(c>a&&c>b){if(a>b) printf("%d,%d,%d",c,a,b);else printf("%d,%d,%d",c,b,a);}getchar();}
2023-07-07 20:55:472

高分求一个汇编语言的完整程序!

已发
2023-07-07 20:56:036

C语言中一个子函数怎么调用另一个子函数的运算?

#include<stdio.h>void fun2(char a1,char a2,char *a3,int b1,int b2,int *b3,float c1,float c2,float *c3){*a3=a1+a2;*b3=b1+b2;*c3=c1+c2;}void fun1(void){char a1=1,a2=2,a3;int b1=100,b2=300,b3;float c1=5.1,c2=6.8,c3;fun2(a1,a2,&a3,b1,b2,&b3,c1,c2,&c3);printf("a3=%d b3=%d c3=%f ",a3,b3,c3);}int main(){fun1();return 0;}
2023-07-07 20:56:181

C语言题目输入一行字符,分别统计出其中英文字母,空格,数字和其他字符的个数。

#include<stdio.h>int main(){char c;int letters=0,space=0,digit=0,other=0;printf("请输入一段字符 ");while((c=getchar())!=" "){if(c>="a"&&c<="z"||c>="A"&&c<="Z")letters++;else if(c==" ")space++;else if(c>="0"&&c<="9")digit++;elseother++;}printf("字母数:%d 空格数:%d 数字数:%d 其他字符数:%d ",letters,space,digit,other);return 0;}如果没有问题请采纳 谢谢
2023-07-07 20:56:3210

请VB.net高手帮忙看一下这个错误 Fill 参数太多

简单的看了下,你代码写的也太不规范了吧?中西结合啊,你以为中西结合代码就很牛B吗?还是全英文吧。Fill方法有11个重载版本的,但是也不是很复杂,因为我们用的时候也就那么一两个。Fill(DataSet)和Fill(dataset ,tablename)。例如Da.Fill(objDataSet),或者Da.Fill(objDataSet,"Users")。我经常用第二种。你代码中的PasswordTextBox.Text是怎么回事?恕我眼拙!
2023-07-07 20:57:192

mcs 51系列单片机

你这是考试题,还是自己看书吧,书上写的很清楚…
2023-07-07 20:57:491

关于c语言中的类型转换,谢谢了啊!!!

显然是对的嘛!!!
2023-07-07 20:57:572

c++中怎样用枚举类型数据作为二维数组的元素?

#include <stdio.h>enum something{ aa,bb,cc,dd,ee,ff,gg} ;void main(){enum something x[2][3]; int i,j;x[0][0]=dd;x[0][1]=ee;x[0][2]=ff;x[1][0]=aa;x[1][1]=bb;x[1][2]=cc;for (j=0;j<2;j++){for (i=0;i<3;i++) printf("%d ",x[j][i]);printf(" ");}}-------------------------------C++ 头文件换#include<iostream>using namespace std;输出用for (j=0;j<2;j++){for (i=0;i<3;i++) cout << x[j][i] << " ";cout << endl;}
2023-07-07 20:58:114