C语言 7.docx

上传人:b****5 文档编号:8809343 上传时间:2023-05-15 格式:DOCX 页数:21 大小:2.10MB
下载 相关 举报
C语言 7.docx_第1页
第1页 / 共21页
C语言 7.docx_第2页
第2页 / 共21页
C语言 7.docx_第3页
第3页 / 共21页
C语言 7.docx_第4页
第4页 / 共21页
C语言 7.docx_第5页
第5页 / 共21页
C语言 7.docx_第6页
第6页 / 共21页
C语言 7.docx_第7页
第7页 / 共21页
C语言 7.docx_第8页
第8页 / 共21页
C语言 7.docx_第9页
第9页 / 共21页
C语言 7.docx_第10页
第10页 / 共21页
C语言 7.docx_第11页
第11页 / 共21页
C语言 7.docx_第12页
第12页 / 共21页
C语言 7.docx_第13页
第13页 / 共21页
C语言 7.docx_第14页
第14页 / 共21页
C语言 7.docx_第15页
第15页 / 共21页
C语言 7.docx_第16页
第16页 / 共21页
C语言 7.docx_第17页
第17页 / 共21页
C语言 7.docx_第18页
第18页 / 共21页
C语言 7.docx_第19页
第19页 / 共21页
C语言 7.docx_第20页
第20页 / 共21页
亲,该文档总共21页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

C语言 7.docx

《C语言 7.docx》由会员分享,可在线阅读,更多相关《C语言 7.docx(21页珍藏版)》请在冰点文库上搜索。

C语言 7.docx

C语言7

19.以下程序的功能是:

建立一个带有头结点的单向链表,并将存储在数组中的字符依次转储到链表的各个结点中,请为下划线处有号码的选择出正确的选项。

#include

stuctnode

{chardata;structnode*next;};

___(48)___CreatList(char*s)

{structnode*h,*p,*q;

h=(structnode*)malloc(sizeof(structnode));

p=q=h;

while(*s!

='\0')

{p=(structnode*)malloc(sizeof(structnode));

p->data=______;

q->next=p;

q=______;

s++;

}

p->next='\0';

returnh;

}

main()

{charstr[]="linklist";

structnode*head;

head=CreatList(str);

...

23.。

若a、b、c1、c2、x、y均是整型变量,正确的switch语句是______。

switch(a+b);

{case1:

y=a+b;break;

case0:

y=a-b;break;

}

switch(a*a+b*b)

{case3:

case1:

y=a+b;break;

case3:

y=b-a;break;

}

switcha

{casec1:

y=a-b;break;

casec2:

x=a*b;break;

default:

x=a+b;

}

switch(a-b)

{default:

y=a*b;break;

case3:

case4:

x=a+b;break;

case10:

case11:

y=a-b;break;

32.。

下面rotate函数的功能是:

将n行n列的矩阵A转置为A',例如:

|1234|

|5678|

当A=|9101112|

|13141516|

|15913|

|261014|

则A'=|371115|

|481216|

请填空。

#defineN4

voidrotate(inta[][])

{inti,j,t;

for(i=0;i

for(j=0;______;j++)

{t=a[i][j];

______;

a[j][i]=t;

}

}

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 幼儿教育 > 少儿英语

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2