Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class GPU {
- public:
- string model;
- void showdata() {
- cout << model << endl;
- }
- };
- class CPU {
- public:
- string model_name;
- void showdata() {
- cout << model_name << endl;
- }
- };
- class Compukter {
- public:
- GPU gpu;
- CPU cpu;
- void setdata(GPU _gpu, CPU _cpu) {
- gpu = _gpu;
- cpu = _cpu;
- }
- void showdata() {
- cout << gpu.model << endl;
- cout << cpu.model_name << endl;
- }
- };
- int main()
- {
- setlocale(LC_ALL, "rus");
- string modele1 = "PowerPC G5";
- string modele2 = "Radeon 5500";
- Compukter c1;
- c1.cpu.model_name = modele1;
- c1.gpu.model = modele2;
- c1.showdata();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement