Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: JRomsponCH

Problemset: Ingredient Validator

Language: cpp

Time: 0.002 second

Submitted On: 2025-09-29 14:36:27

#include<iostream>
using namespace std;

int main() {
    string season, moon, ingredient;
    cin>>season>>moon>>ingredient;
    if (season == "spring" or season == "summer")
    {
        if (moon == "full")
        {
            if (ingredient == "honey" or ingredient == "milk")
            {
                cout<<"Ingredient accepted!";
            }
            else
            {
                cout<<"Ingredient rejected!";
            }
        }
        else if (moon == "new" and ingredient != "chocolate")
        {
            cout<<"Ingredient rejected!";
        }
        else
        {
            cout<<"Ingredient accepted!";
        }
    }
    else if (season == "winter" or season == "autumn")
    {
        if (moon == "waning" or moon == "new")
        {
            if (ingredient == "chocolate" or ingredient == "milk")
            {
                cout<<"Ingredient accepted!";
            }
            else
            {
                cout<<"Ingredient rejected!";
            }
        }
        else
        {
            cout<<"Ingredient accepted!";
        }
    }
    else
    {
        cout<<"Ingredient rejected!";
    }
    return 0;
}