c语言程序填空

更新时间:02-11 教程 由 青果 分享

本文是一篇关于填空题的C语言程序的,主要介绍了一些提高篇的填空题,希望能够对读者的编程能力有所提升。

1. 填空题1

下面是一个C语言程序的代码,填写正确后可以实现对数组进行排序的功能。

```clude

tt b) {tp = a;

a = b;p;

tt) {t - 1; i++) {t - i - 1; j++) {

if (/ 1 /) {

swap(&arr[j], &arr[j + 1]);

}

}

}

tain() {t arr[] = {5, 2, 4, 6, 1, 3};t = sizeof(arr) / sizeof(arr[0]););t; i++) {tf("%d ", arr[i]);

} 0;

答案 `arr[j] >arr[j + 1]`

2. 填空题2

下面是一个C语言程序的代码,填写正确后可以实现对链表进行反转的功能。

```cludeclude

struct Node {t val;

struct Node reverse_list(struct Node head) {

struct Node prev = NULL;

struct Node curr = head;ext = NULL;

while (curr != NULL) {extext = prev;

prev = curr;

} prev;

tain() {

head->val = 0;

p1->val = 1;

p2->val = 2;

p3->val = 3;ext = p1;ext = p2;ext = p3;ext = NULL;ew_head = reverse_list(head);ew_head;

while (p != NULL) {tf("%d ", p->val);

} 0;

ext = prev`

3. 填空题3

下面是一个C语言程序的代码,填写正确后可以实现对字符串进行翻转的功能。

声明:关于《c语言程序填空》以上内容仅供参考,若您的权利被侵害,请联系13825271@qq.com
本文网址:http://www.25820.com/tutorial/14_2119804.html