摘要: 验证性实验1: ①文件用于读; ②二进制方式; 没有文件file3.txt。 #include <stdio.h> #include <stdlib.h> #include <string.h> const int N = 10; // 定义结构体类型struct student,并定义其别名为ST 阅读全文
posted @ 2019-12-31 19:41 在雨中等你 阅读(108) 评论(1) 推荐(0)
摘要: 实验结论: Part 1: #include <stdio.h> #include <stdlib.h> #include <string.h> const int N=5; // 定义结构体类型struct student,并定义STU为其别名 typedef struct student { l 阅读全文
posted @ 2019-12-24 22:05 在雨中等你 阅读(79) 评论(2) 推荐(0)
摘要: Part 1实验结论:A B G Part 2: 2-1-1: // 练习:使用二分查找,在一组有序元素中查找数据项 // 形参是数组,实参是数组名 #include <stdio.h> #include <stdlib.h> const int N=5; int binarySearch(int 阅读全文
posted @ 2019-12-17 21:48 在雨中等你 阅读(86) 评论(5) 推荐(0)
摘要: #include <math.h> #include <stdio.h> #include <stdlib.h> // 函数声明 void solve(double a, double b, double c); // 主函数 int main() { double a, b, c; printf( 阅读全文
posted @ 2019-12-03 23:25 在雨中等你 阅读(120) 评论(1) 推荐(0)
摘要: #include<stdio.h> int main() { int n,a; float i,j,m,s; j=1,m=0,s=0; printf("Enter n and a:"); scanf("%d%d",&n,&a); for(i=1;i<=n;i++) { m=m+a*j; j=j*10 阅读全文
posted @ 2019-11-19 22:51 在雨中等你 阅读(103) 评论(5) 推荐(0)
摘要: #include <stdio.h> int main() { int x=1234; float f=123.456; double m=123.456; char ch='a'; char a[]="Hello, world!"; // 定义一个数组a,数组中连续存放了字符串常量hello,wo 阅读全文
posted @ 2019-11-06 02:14 在雨中等你 阅读(108) 评论(3) 推荐(0)
摘要: #include int main() { int days; printf("输入一个整数: \n"); scanf("%d",&days); // 补足×××处的表达式,使得满足程序功能描述 if(days>=1&&days int main() { char ch; ... 阅读全文
posted @ 2019-10-21 12:31 在雨中等你 阅读(179) 评论(0) 推荐(0)