You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
379 B

#ifndef TYRE_H
#define TYRE_H
#include <iostream>
class Tyre // 轮胎类,这里使用了大驼峰命名风格
{
std::string brand{}; // 轮胎品牌
public:
Tyre(const std::string &_brand) : brand{_brand}
{
}
Tyre() = default; // 主动合成的默认构造
void print()
{
std::cout << "轮胎品牌是" << brand << '\n';
}
};
#endif