#include <iostream>
#include <string>
#include <vector>
class Planet {
std::string name;
float weight;
std::string structure;
int pressure;
int count_sputniks;
public:
Planet() {
name = "";
weight = 0;
structure = "";
pressure = 0;
count_sputniks = 0;
}
Planet(std::string name, float weight, std::string structure, int pressure, int counts_sputniks) {
this->name = name;
this->weight = weight;
this->structure = structure;
this->pressure = pressure;
this->count_sputniks = counts_sputniks;
}
void printInfo() {
std::cout <<name << "\n Масса " << weight << " масс Земли\n Состав атмосферы "<<
structure << "\n Давление у поверхности: " << pressure << "\n Кол-во спутников: "<< count_sputniks << "\n";
}
};
int main() {
system("chcp 1251");
std::vector<Planet> planets;
Planet planet1("Планета обезьян",10,"Обезьяны",10000,100);
Planet planet2("Планета капибар",8,"Капибары",1,0);
Planet planet3("Шутки про папу",0,"А где он???",0,0);
planets.push_back(planet1);
planets.push_back(planet2);
planets.push_back(planet3);
for (int i = 0; i < planets.size(); i++)
{
planets.at(i).printInfo();
}
}