fqy131314

2022年7月25日

地震监测系统(简单实现)

摘要: #include <iostream> #include <string> #include <cmath> #include <Windows.h> #include <fstream> using namespace std; const double THRESHOLD=1.5; double 阅读全文

posted @ 2022-07-25 11:25 会飞的鱼-blog 阅读(29) 评论(0) 推荐(0)

2022年7月23日

动态内存分配

摘要: 阅读全文

posted @ 2022-07-23 15:57 会飞的鱼-blog 阅读(12) 评论(0) 推荐(0)

编写一个程序,初始化一个double类型的数组,然后把该数组的内容拷贝至3个其他数组中(在main()中声明这4个数组)。

摘要: 使用带数组法的函数进行第一份拷贝。使用带指针表示法和指针递增的函数进行第二份拷贝。把目标数组名和待拷贝的元素个数作为前两个函数的参数。第3个函数以目标数组名、源数组名和指向源数组最后一个元素后面的元素的指针。也就是说,给定以下声明,则函数调用如下所示: double source[5]={1.1,2 阅读全文

posted @ 2022-07-23 14:25 会飞的鱼-blog 阅读(46) 评论(0) 推荐(0)

实现一个函数,使用指针连接两个字符串。函数输入:两个源字符串的指针,目的字符串的指针。

摘要: #include <iostream> #include <Windows.h> #include <string> using namespace std; bool str_cat(char *a1,char *a2,char *a3,int len) { int pos=0; if(!a3|| 阅读全文

posted @ 2022-07-23 12:10 会飞的鱼-blog 阅读(21) 评论(0) 推荐(0)

2022年7月22日

实现一个函数,函数完成功能如下:

摘要: 1.函数的输入为一个数组,数组的成员个数不定(即:可能为0,也可能为多个) 2.函数找到成员的最大元素和最小元素,并能让函数的调用者知道最大元素和最小元素是哪一个 #include <iostream> #include <Windows.h> using namespace std; bool m 阅读全文

posted @ 2022-07-22 11:54 会飞的鱼-blog 阅读(26) 评论(0) 推荐(0)

有一个整型数组,a[3]={2,3,7};要求使用指针实现数组成员从小到大的顺序排列。

摘要: #include <iostream> #include <Windows.h> using namespace std; void sort(int *b) { int tmp; for(int i=0;i<3;i++) { for(int j=i;j<3;j++) { if(b[i]>b[j]) 阅读全文

posted @ 2022-07-22 11:32 会飞的鱼-blog 阅读(15) 评论(0) 推荐(0)

用C++实现字符的逆转

摘要: #include <iostream> #include <Windows.h> #include <string.h> using namespace std; void reverse(unsigned char *a) { unsigned char *p1=a; unsigned char 阅读全文

posted @ 2022-07-22 11:17 会飞的鱼-blog 阅读(23) 评论(0) 推荐(0)

2022年7月13日

C++学习笔记(day1)

摘要: using namespace std; //用命名空间std C++中如果想要输出表示自己想要的位数,可以使用: cout.precision(位数); 如果想要规范小数位数,需要添加以下语句: cout.flags(cout.fixed); cout.precision(位数); 无符号数: 不 阅读全文

posted @ 2022-07-13 12:39 会飞的鱼-blog 阅读(12) 评论(0) 推荐(0)

2022年5月27日

用C++实现推箱子(小人和推着箱子能过地板版)

摘要: 源代码: #include <iostream> #include <Windows.h> #include <graphics.h> #include <conio.h> #include "box_man.h" void changeMap(struct _POS *pos,enum _RES 阅读全文

posted @ 2022-05-27 13:57 会飞的鱼-blog 阅读(44) 评论(0) 推荐(0)

2022年5月24日

推箱子小游戏(c++实现)

摘要: 项目实现准备工作: 1.安装easyX,vs2010版本。 以下是自己写的代码 源代码: #include <iostream> #include <Windows.h> #include <string> #include <graphics.h> #include <conio.h> #incl 阅读全文

posted @ 2022-05-24 22:02 会飞的鱼-blog 阅读(134) 评论(0) 推荐(0)

导航