摘要: part 1 验证性实验二 仍然正确 总结: 二进制文件与文本文件的区别: 文本文件只能存储char型字符变量,二进制文件可以存储char/int等各种变量值。 #include <stdio.h> #include <stdlib.h> #include <string.h> const int 阅读全文
posted @ 2020-01-01 02:29 Uzivn 阅读(106) 评论(2) 推荐(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-23 17:05 Uzivn 阅读(112) 评论(2) 推荐(0)
摘要: // 练习:使用二分查找,在一组有序元素中查找数据项 // 形参是数组,实参是数组名 #include <stdio.h> #include <stdlib.h> const int N=5; int binarySearch(int x[], int n, int item); // 函数声明 i 阅读全文
posted @ 2019-12-18 00:08 Uzivn 阅读(116) 评论(3) 推荐(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-12-02 20:34 Uzivn 阅读(115) 评论(2) 推荐(0)
摘要: // 一元二次方程求解 // 重复执行, 直到按Ctrl+D或Ctrl+E结束 // #include <math.h> #include <stdio.h> #include <stdlib.h> int main() { float a, b, c, x1, x2; float delta, r 阅读全文
posted @ 2019-11-20 00:13 Uzivn 阅读(101) 评论(4) 推荐(0)
摘要: int main() { int x=1234; float f=123.456; double m=123.456; char ch='a'; char a[]="Hello, world!"; // 定义一个数组a,数组中连续存放了字符串常量hello,world! int y=3, z=4; 阅读全文
posted @ 2019-11-06 00:28 Uzivn 阅读(102) 评论(3) 推荐(0)
摘要: #include #include int main() { int a; printf("请输入一个整数:"); scanf("%d",&a); if(a%2==0) printf("%d为偶数!",a); else printf("%d为奇数!"); system("pause"); return 0; } #... 阅读全文
posted @ 2019-10-22 09:21 Uzivn 阅读(123) 评论(0) 推荐(0)