2023年12月23日
摘要: 头歌作业 回文判断 #include <stdio.h> #include <string.h> #define MAX_LEN 80 int IsReverse(const char *str); int main(void) { char str[MAX_LEN]; printf("Input 阅读全文
posted @ 2023-12-23 19:35 lulixiu 阅读(50) 评论(0) 推荐(0) 编辑
摘要: 结构体 声明结构体变量的四种方式 1.先定义结构体,再声明结构体变量 struct student{ long number; char name[20]; char sex; float score; };//先定义结构体 struct student s1,s2;//声明结构体变量 2.在定义结 阅读全文
posted @ 2023-12-23 19:34 lulixiu 阅读(14) 评论(1) 推荐(0) 编辑
摘要: 必学工具 vim编辑器 emacs编辑器 进阶,git github开源社区 GNU Make提升效率 Cmake更抽象 让排版自动专业Latex 轻量级虚拟机docker 配环境节省时间scoop 日常工作学习流 Obsidian ,其中Annotator笔记能跳转到原文,Anki生成卡片链接 电 阅读全文
posted @ 2023-12-23 19:33 lulixiu 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 函数篇 编写一个函数,可以实现给出算数运算的功能,给出两个值以及算数运算符号可以算出相应的结果 #include<stdio.h> int math(int a,int b,char c);//开头声明一个自己定义的函数 int main() { int a,b,c,sum; printf("请输入 阅读全文
posted @ 2023-12-23 19:33 lulixiu 阅读(25) 评论(0) 推荐(0) 编辑
  2023年11月23日
摘要: 必学工具 vim编辑器 emacs编辑器 进阶,git github开源社区 GNU Make提升效率 Cmake更抽象 让排版自动专业Latex 轻量级虚拟机docker 配环境节省时间scoop 日常工作学习流 Obsidian ,其中Annotator笔记能跳转到原文,Anki生成卡片链接 电 阅读全文
posted @ 2023-11-23 20:40 lulixiu 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 1.插入排序 #include"stdio.h" #define N 5 int main() { //1 2 3 4 5 //2 1 3 4 5 int a[N]={1,2,3,4,5},i,j,tmp; for(i=1;i<N;i++) { j=i-1; tmp=a[i]; while(a[j] 阅读全文
posted @ 2023-11-23 20:17 lulixiu 阅读(3) 评论(0) 推荐(0) 编辑
摘要: #include"stdio.h" int main() { int x=5; int *p=&x; *p=6;//可以不改变x的值来修改输出 int* (*q)=&p;//即p=*q int*(*(*r))=&q;//即r=*p printf("%d\n",*p); printf("%d\n",* 阅读全文
posted @ 2023-11-23 20:12 lulixiu 阅读(3) 评论(0) 推荐(0) 编辑
  2023年11月17日
摘要: 头歌作业复盘2 1.找鞍点,具有m行n列二维数组Array的“鞍点”,即该位置上的元素在该行上最大,在该列上最小 #include <stdio.h> void find(int a[100][100],int m,int n) { int i,j,k; for(i=0;i<m;i++)//一行一循 阅读全文
posted @ 2023-11-17 18:57 lulixiu 阅读(27) 评论(0) 推荐(0) 编辑
  2023年11月16日
摘要: 打印n行杨辉三角未完成篇,最后一行第一个数字有空格版,评测了80多次 #include <stdio.h> void main() { int n,i,j,k; scanf("%d", &n); int a[n][n]; //生成杨辉三角 for (i = 0; i < n; i++)///行 { 阅读全文
posted @ 2023-11-16 20:22 lulixiu 阅读(20) 评论(0) 推荐(0) 编辑
  2023年11月13日
摘要: 用printf来展示指针的用法 p还是取a的地址,改了p的值后地址还是不变 指向指针的指针 效果如上 最上面是堆,第二个是栈,stack overflow是栈溢出 没有取地址就不会输出任何东西 两个是等价的,然后区分于*p&A 二维数组的第二维就是一维数组里的数组 加的字节 简要写法 就像栈结构一样 阅读全文
posted @ 2023-11-13 00:27 lulixiu 阅读(4) 评论(0) 推荐(0) 编辑