- 博客(5)
- 收藏
- 关注
原创 C++ work4
#include <iostream> using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */ class Dog { public: //构造函数 Dog(){ ++count; } //拷贝构造函数 Dog( const Dog & g ){ ++coun.
2022-01-03 22:33:49 228
原创 C++ work2
#include <iostream> using namespace std; //定义3维矢量类 class Vector3{ public: //定义构造函数,并设置默认值0 Vector3(double x=0, double y=0, double z=0){ this->x = x; this->y = y; this->z = z; } //重载 "+" 操作符 const 不是必须的,最好加上。 Vec.
2022-01-03 22:32:53 159
原创 C++ work3
#include <iostream> using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */ //定义基类 class Vehicle { public: //定义构造函数 Vehicle( double maxSpeed, double weight ){ this->m.
2022-01-03 22:32:12 429
原创 C++实验一、、
#include <iostream> using namespace std; #include <stdlib.h> //使用srand()函数引入类库 #include <time.h> class Bakery { public: const double fixedCost; //注意常量的初始化 Bakery(); Bakery(double breadPrice, int breadCount=100); //默认参数放在最.
2022-01-03 22:27:24 44
原创 C++实验一
#include <iostream> using namespace std; #include <stdlib.h> //使用srand()函数引入类库 #include <time.h> class Bakery { public: const double fixedCost; //注意常量的初始化 Bakery(); Bakery(doubl...
2022-01-03 22:24:32 309
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人