摘要: 结果仍然正确 二进制文件直接打开是杂乱的。而文本文件不会。 #include <stdio.h> #include <stdlib.h> #define N 10 // 定义一个结构体类型STU typedef struct student { int num; char name[20]; int 阅读全文
posted @ 2019-12-30 12:08 孔丘在世 阅读(124) 评论(3) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> const int N=5; // 定义结构体类型struct student,并定义STU为其别名 typedef struct student { long no; char name[20]; int score; 阅读全文
posted @ 2019-12-21 12:34 孔丘在世 阅读(139) 评论(2) 推荐(0)
摘要: // 练习:使用二分查找,在一组有序元素中查找数据项 // 形参是数组,实参是数组名 #include <stdio.h> #include <stdlib.h> const int N=5; int binarySearch(int x[], int n, int item); // 函数声明 i 阅读全文
posted @ 2019-12-17 23:51 孔丘在世 阅读(108) 评论(2) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> #define N 1000 int fun(int n,int m,int bb[N]) { int i,j,k=0,flag; for(j=n;j<=m;j++) { flag=1; for(i=2;i<j;i++) 阅读全文
posted @ 2019-11-30 23:10 孔丘在世 阅读(94) 评论(2) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> int main() { int number, max, min, n; n=1; printf("输入第%d个数 ", n); scanf("%d", &number); max = number; min = num 阅读全文
posted @ 2019-11-18 11:28 孔丘在世 阅读(146) 评论(3) 推荐(0)
摘要: 1前两个一致, 第一1234靠右对齐,补4空,第二12344位大于2不空位 f的精度不够 8f不变 后面保留一位和二位小数。e为固定模式 一致 %3c指的是在该字符前在空两个空格 helloworld按字符串输出,。几表示有几位。15s表有20位右靠。 2地址符和精度问题(少l) 3%ld 适用lo 阅读全文
posted @ 2019-11-03 16:36 孔丘在世 阅读(193) 评论(2) 推荐(0)
摘要: 阅读全文
posted @ 2019-10-23 22:19 孔丘在世 阅读(117) 评论(0) 推荐(0)