#45812: cpp 超級簡單解


1121232@stu.wghs.tp.edu.tw (Ian911436)

學校 : 臺北市私立薇閣高級中學
編號 : 258883
來源 : [60.248.154.143]
最後登入時間 :
2025-06-20 09:40:35

#include <bits/stdc++.h>
using namespace std;
 
int main() {
int a, b, c, d, e;
    cin >> a >> b >> c >> d >> e;
    int sum = b + c + d + e;
    if(a >= sum){
        cout << sum;
    }
    else{
        cout << "-1";
    }
    return 0;
}