摘要: 一、引入 质数(素数):只能被1和本身整除的数,0和1既不是质数也不是合数 实际上是求素数的一种算法 二、代码 #include <stdio.h> #define N 100 void main(){ int i,array[N],j; //0和1既不是质数也不是合数 array[0]=0; ar 阅读全文
posted @ 2019-12-25 11:07 小菜将夜 阅读(265) 评论(0) 推荐(0)
摘要: 一、代码 #include <stdio.h> #include <stdlib.h> void main(){ int x,*array; printf("需要申请的数组大小:"); scanf("%d",&x); array=malloc(x*sizeof(int)); for(int i=0; 阅读全文
posted @ 2019-12-25 10:10 小菜将夜 阅读(193) 评论(0) 推荐(0)
摘要: 一、代码 ①struct #include <stdio.h> struct Point{ int x; int y; }; void main(){ struct Point point; point.x=1; point.y=2; printf("x:%d,y:%d",point.x,point 阅读全文
posted @ 2019-12-25 09:39 小菜将夜 阅读(83) 评论(0) 推荐(0)