摘要: // 将file1.txt中小写字母转换成大写后,另存为file2.txt #include <stdio.h> #include <stdlib.h> int main() { FILE *fin, *fout; // 定义文件类型指针 int ch; fin = fopen("file1.txt 阅读全文
posted @ 2020-01-01 08:00 小能超可爱 阅读(115) 评论(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-25 01:17 小能超可爱 阅读(126) 评论(3) 推荐(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:26 小能超可爱 阅读(89) 评论(3) 推荐(0)
摘要: //寻找两个整数之间的所有素数(包括这两个整数),把结果保存在数组bb中,函数返回素数的个数。 // 例如,输入6和21,则输出为:7 11 13 17 19。 #include <stdio.h> #include <stdlib.h> #define N 1000 int fun(int n,i 阅读全文
posted @ 2019-12-03 00:35 小能超可爱 阅读(117) 评论(2) 推荐(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 阅读全文
posted @ 2019-11-20 00:57 小能超可爱 阅读(110) 评论(3) 推荐(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",y,z) 阅读全文
posted @ 2019-11-06 01:26 小能超可爱 阅读(134) 评论(3) 推荐(0)
摘要: part3 实验总结与体会: 对于一些符号代码无法熟练使用,需要花时间经常训练。一些表达式一时间想不出来,需提升这方面能力 阅读全文
posted @ 2019-10-20 16:48 小能超可爱 阅读(111) 评论(0) 推荐(0)