#include <iostream>
using namespace std;

class Product {
public:
    int price;
    int discount;
    int fin;

    void finalPrice() {
    if (discount > 0 && discount < 100) {
        fin = price * (100 - discount) / 100;
        if (fin > 0) {
            cout << fin <<endl;
        }else{
            cout << "가격 오류" <<endl;
        }
    }else{
            cout << "잘못된 할인율"<<endl;
         }

    }
};

int main() {
    Product p;

    cin >> p.price;
    cin >> p.discount;
    p.finalPrice();
}

Embed on website

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