#include <iostream>
using namespace std;

class Thermostat {
public:
    int temp;

    Thermostat(int t) : temp(t) {}

    void check_status() {
        if (temp >= 28)
            cout << "에어컨 가동" << endl;
        else if (temp <= 18)
            cout << "히터 가동" << endl;
    }
};

int main() {
    Thermostat t1(30);
    t1.check_status();
    Thermostat t2(15);
    t2.check_status();
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: