![](https://img-blog.csdnimg.cn/2019091813595558.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
C-language
文章平均质量分 79
Some knowledge of C language
Nick5_daisy
学习者
展开
-
C语言_保存_读取_链表数据到文件
/*本程序练习链表数据结构的保存数据到文件和从文件读取数据的操作*/#include<stdio.h>#include<string.h>#define PATH "data_link.dat"//文件保存路径//定义一个数据结构体typedef struct MyData{ int a_data; char c_data;}MyData;//根据数据结构体定义链表的结构体typedef struct MyList{ MyData data; .原创 2020-07-04 10:52:55 · 5482 阅读 · 6 评论 -
C语言,链表:_交换两节点_释放链表_新建节点_插入节点_遍历链表_查找节点_修改节点_删除节点_排序节点_
#include<stdio.h>#include<stdlib.h>#include<string.h>#define LEN 6struct mylist{ int data; struct mylist* next;};/*函数名:create_node函数功能:新建节点返回值:struct *参数:int data*/struct mylist* create_node(int data);/*函数名:insert_hea.原创 2020-06-12 03:21:11 · 249 阅读 · 0 评论 -
c-language file operations
Open text files.FunctionFILE *fopen(char *panme,char *mode);The return valuesucessfailurefile pointerNULL pointeParameters原创 2020-06-11 16:20:37 · 108 阅读 · 0 评论 -
Matrix multiplication,C language
Matrix multiplication has the premise that the number of columns in the first matrix is equal to the number of rows in the second matrix.The product of a (aXb) matrix and a (bXc) matrix is an (aXc) matrix.#include<stdio.h>int main(void){ i原创 2020-06-01 23:27:13 · 140 阅读 · 0 评论 -
C language: The greatest common divisor and the least common multiple
#include<stdio.h>int main(void){ int m, n, max, min; printf("输入m.n\n"); scanf("%d %d", &m, &n); int mn = m * n; if (m < n) { int temp = m; m...原创 2020-02-08 15:42:32 · 186 阅读 · 0 评论 -
C language:two sorting algorithms:Bubble Sort and Election Sort
//C language:two sorting algorithms:Bubble Sort and Election Sort#include <stdio.h>#include<stdlib.h>void sort_elect(int* a, int len);void sort_bubbling(int* a, int len);int main(v...原创 2020-02-05 13:41:25 · 146 阅读 · 0 评论 -
C语言_打印文字到_txt文件
有一个变量x=5,打印如下一段文字: 你是正确的: 3+5=8其中x为变量。#include<stdio.h>void main(){ int x=5; FILE *fp=fopen("test01.txt","w+");//从头开始写 fprintf(fp,"你是正确的:\n3+%d=8",x); ...原创 2019-11-13 02:26:56 · 400 阅读 · 0 评论