main.c

来自「此文件描述的是双向链表的基本用法 以及根据输入的数字 计算其频度 来进行排序」· C语言 代码 · 共 40 行

C
40 行
字号
/*
*函数名称:   主函数
*
*函数功能:   建立一个双向循环链表 根据输入元素的频度进行排序
*
*函数修改时间:  08-09-15
*
*

*/
#include <stdlib.h>
#include <stdio.h>
#include "userconst.h"
#include "list_operate.h"


void main(void)
{
	unsigned int element = 0;
	struct list_node *head;
    
    head = (struct list_node *)malloc(sizeof(struct list_node));;

	head->prior = head;
	head->next = head;
	head->freq = 0;
	head->data = 0;

	head = init_list(head);

	while(1)
    {
		printf("请您输入元素值\n");
   
        scanf("%u", &element);
		
		printf("结果如下\n");
		output_list(head, element);
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?