摘要: 结果正确 文本文件存储的是常规字符串,文本文件可以使用字处理软件如gedit、记事本进行编辑。 二进制文件把对象内容以字节串进行存储,需要使用专门的软件进行解码后读取、显示、修改或执行。 #include <stdio.h> #include <stdlib.h> #define N 10 // 定 阅读全文
posted @ 2019-12-30 23:07 叉歪劈九叉 阅读(125) 评论(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-23 12:22 叉歪劈九叉 阅读(186) 评论(3) 推荐(0)
摘要: // 练习:使用二分查找,在一组有序元素中查找数据项// 形参是数组,实参是数组名 #include <stdio.h>#include <stdlib.h> const int N=5; int binarySearch(int x[], int n, int item); // 函数声明 int 阅读全文
posted @ 2019-12-18 01:27 叉歪劈九叉 阅读(155) 评论(3) 推荐(0)
摘要: #include <stdio.h>#include <stdlib.h> #define N 1000int 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++) if 阅读全文
posted @ 2019-12-03 14:32 叉歪劈九叉 阅读(79) 评论(1) 推荐(0)
摘要: #include <math.h>#include <stdio.h>#include <stdlib.h>int main() { float a, b, c, x1, x2; float delta, real, imag; printf("Enter a, b, c: "); while(sc 阅读全文
posted @ 2019-11-18 11:43 叉歪劈九叉 阅读(155) 评论(2) 推荐(0)
摘要: #include <stdio.h> int main() { int x=1234; float f=123.456; double m=123.456; char ch='a'; char a[]="Hello, world!"; int y=3, z=4; printf("%d %d\n", 阅读全文
posted @ 2019-11-06 02:40 叉歪劈九叉 阅读(141) 评论(3) 推荐(0)
摘要: #include <stdio.h> int main() { int x; printf("输入一个整数: \n"); scanf("%d",&x); if(x%2==0 ) printf("是偶数"); else printf("是奇数"); return 0; } #include <stdi 阅读全文
posted @ 2019-10-22 09:37 叉歪劈九叉 阅读(95) 评论(0) 推荐(0)