#include <stdio.h> int rear(int q[], int length){ int rear = q[length - 1]; return rear; } int main(){ int queue[10], length = 10; // 将队列元素初始化为 0 到 9 for (int i = 0; i < length; i++) queue[i] = i; printf("队尾元素为:%d\n", rear(queue, length)); return 0; }
编写一个使用循环队列 返回 队列中队尾元素的程序
最新推荐文章于 2024-04-24 16:06:48 发布