- 博客(5)
- 收藏
- 关注
原创 双链表(带头循环)
1、基础模式//头文件模块 List.h//双向带头循环#include <stdio.h>#include <stdlib.h>#include <assert.h>struct ListNode{ //两个指针,双向 struct ListNode* next; struct ListNode* prev; int data;};typedef struct ListNode ListNode;ListNode* ListInit();
2021-09-29 17:00:04
134
原创 单链表 尾插,头插,头删,尾删,任意插入、删除
//头文件模块 List.h#include <stdio.h>#include <stdlib.h>struct SListNode{ int data;//数据、节点 struct SListNode* next;//指向结构体的指针,指向下一个结点};typedef struct SListNode SLTnode;void Print(SLTnode*pphead);//打印void SListPushback(SLTnode**pphead, int .
2021-09-22 20:54:09
209
原创 顺序表 头插头删 尾插尾删
//头文件 List.h#include <stdio.h>#include <stdlib.h>#include <assert.h>//顺序表,有效数组在数组中必须是连续的//动态顺序表设计typedef int data;//便于更改数据类型typedef struct Sqlist{ data* a; int size;//使用数据个数 int capacity;//总容量}Sqlist;//函数声明void Listinit(.
2021-09-06 18:18:42
190
原创 C语言牛客网输入字符打印金字塔
int main(){ int i = 0; int j = 0; char ch = 0; ch = getchar();//接收输入字符 for (i = 0; i < 5; i++) { //打印空格 for (j = 0; j < 4 - i; j++) { printf(" "); } //打印字符+空格 for (j = 0; j <= i; j++) { printf("%c ",ch); } printf("\.
2021-09-01 19:27:55
390
原创 C语言猜数字小游戏项目实现
思路:实现一个游戏菜单,选择1是玩游戏,0是退出游戏;进入游戏模块后先要生成一个0~100的随机数,再和你输入的数比较,直到猜对为止。#include <stdio.h>#include <strlib.h> //srand rand的头文件#include <time.h> //time的头文件void menu(){ printf("******欢迎来到猜数字小游戏******\n"); printf("****************
2021-09-01 15:14:16
249
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅