1 条题解

  • 0
    @ 2022-9-28 15:59:14
    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
        int money = 0;  //津津手里的钱数
        int mother = 0; //存在妈妈那的钱数
        for (int i = 1; i <= 12; i++)
        {
            money += 300; //发钱了
            int x;
            cin >> x;   //当前月的预算
            money -= x; //花钱
            if (money < 0)
            {
                //预算不够了
                cout << -i;
                break;
            }
            //存钱
            mother += money / 100 * 100;
            money = money % 100;
        }
        if (money >= 0)
            cout << mother * 120 / 100 + money;
        return 0;
    }
    
    • 1

    信息

    ID
    294
    时间
    1000ms
    内存
    128MiB
    难度
    5
    标签
    (无)
    递交数
    207
    已通过
    82
    上传者