- 博客(7)
- 收藏
- 关注
原创 读取文件中内容并打印
#include <stdlib.h>#include <stdio.h>#include <string.h>int main(){ FILE* fp = NULL; char ch; errno_t err; err = fopen_s(&fp, 文件路径, "r+"); if (err == 0){ printf("Open File Success!\n"); } else{ printf("Can't Open File\n
2021-12-25 22:24:01
560
原创 C语言斐波那契数列
斐波那契数列递归和循环实现://递归方法#include <stdio.h>int Fib(int i){ if(i == 0 || i == 1) return i; else { return Fib(i - 1) + Fib(i - 2); }}void main(){ printf("%d",Fib(5)); while(1);}//循环方法#include <stdio.h>int Fib(int n){ if(n == 0
2021-03-31 15:32:17
102
原创 链队的基本操作
/*链队的建立和插入输出*/typedef struct node{ int data; struct node *next;}node;typedef struct linkqueue{ struct node *pfront; struct node *prear;}linkqueue;void init_queue(linkqueue *lq){ lq->pfront = NULL; lq->prear = NULL;}bool in_queue(linkqu
2021-03-29 11:29:02
82
原创 C语言链表基本操作
/*合并两个有序链表*/SLIST *add_list(SLIST *m,SLIST *n){ SLIST *head,*p,*s; head = (SLIST *)malloc(sizeof(SLIST)); p = head; while(m != NULL || n != NULL) { s = (SLIST *)malloc(sizeof(SLIST)); if(m != NULL && m->data <= n->data) { s
2021-03-25 20:02:34
163
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人