Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
231290 | 陈柏丞 | *小美的外卖订单 | C++ | 解答错误 | 80 | 8 MS | 276 KB | 425 | 2024-01-13 20:21:46 |
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; double yzj(0), zkj(0), mjj(0); for(int i = 1;i <= n;i++){ double a, b; cin >> a >> b; yzj += a; zkj += b; } cout << fixed << setprecision(2); int x, y; cin >> x >> y; if(yzj >= x){ mjj = yzj-y; }else{ cout << zkj; return 0; } if(zkj < mjj){ cout << zkj; }else{ cout << mjj; } return 0; }