#include <iostream>
using namespace std;

class Movie {
public:
    string name;
    int age;

    void checkAge() {
    if (age > 0) {
        if (age >= 19) {
            cout << "관람 가능" <<endl;
        }else{
            cout << "관련 불가" <<endl;
        }
    }else{
            cout << "잘못된 입력"<<endl;
         }

    }
};

int main() {
    Movie m;

    cin >> m.name;
    cin >> m.age;
    m.checkAge();
}

Embed on website

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