本文是一篇关于填空题的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语言程序的代码,填写正确后可以实现对链表进行反转的功能。
```clude
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语言程序的代码,填写正确后可以实现对字符串进行翻转的功能。