
mooc笔记
Kristian w
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C语言钟负无穷如何表示
1、define inf -9999992、#include<limits.h> 直接用int的最小取值,MIN_INT则正无穷为 MAX_INT,如果要用double 型的,需要加载头文件float.h,然后正无穷为DBL_MAX,负无穷就为-DBL_MAX;原创 2020-09-18 14:29:49 · 2453 阅读 · 0 评论 -
C语言-素数-笔记
任意给出一个数字x,判断是否为素数,是返回1,否返回0(最基本的方法是从2到x-1去除x,若能整除,则不为素数,再改进就是从2到x/2去除x,再改进就是 从2到sqrt(x)去除x,这里不再赘述)方法1先排除掉小于等于1的数字,均不为素数;除了2之外的所有偶数也均不为素数,故也排除掉。接下来用从3到sqrt(x)之间的所有奇数来除x,如果能够整除,则不为素数,跳出循环。int isPrime( int x ){ int ret=1; if(x<=1||(x%2==0&&x原创 2020-05-10 11:17:40 · 320 阅读 · 0 评论 -
C语言-链表-笔记2(链表的输查删)
node.h#ifndef _node_h_#define _node_h_typedef struct _node{ //用typedef是为了后面不用再很麻烦地用struct _node这么长的去定义变量 int value; struct _node *next;// 这里不能用 Node *next;因为程序在读到这一行时下面那个被定义的Node还没有出现 }Node; ...原创 2020-05-06 15:37:03 · 155 阅读 · 0 评论 -
C语言-链表-笔记1(链表结点的定义和插入)
一、链表节点的定义和插入node.h#ifndef _node_h_#define _node_h_typedef struct _node{ //用typedef是为了后面不用再很麻烦地用struct _node这么长的去定义变量 int value; struct _node *next;// 这里不能用 Node *next;因为程序在读到这一行时下面那个被定义的Node还没有...原创 2020-05-05 00:18:04 · 5990 阅读 · 0 评论 -
C语言-结构体-笔记(易错点)
一、声明结构的三种形式1struct point{ int x; int y;};struct point p1,p2;声明一个结构型的变量名,后面还可以用他去定义别的变量2struct { int x; int y;}p1,p2;这种形式用于一次性的定义两个这种结构的变量,后面不需要再去定义3struct point{ int x; int y;}p1,p...原创 2020-05-01 09:41:10 · 1055 阅读 · 0 评论 -
C语言-可变数组-Mooc笔记
array.h#ifndef _array_h_#define _array_h_typedef struct{ int *array; int size;} Array;Array array_creat(int init_size);void array_free(Array *a);int array_size(const Array *a);int* array_at...原创 2020-05-01 08:41:30 · 226 阅读 · 0 评论