1 solutions

  • 0
    @ 2025-1-22 12:12:50

    C++ :

    #include <iostream>
    using namespace std;
    
    int main() {
        int A, B;
        cin >> A >> B;  // 输入巧克力和豆子的价格
    
        // 计算豆子的半价
        int beanCost = B / 2;
    
        // 计算总花费
        int totalCost = A + beanCost;
    
        // 输出结果
        cout << totalCost << endl;
    
        return 0;
    }
    
    • 1

    Information

    ID
    698
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    10
    Tags
    # Submissions
    1
    Accepted
    1
    Uploaded By