提交时间:2024-01-13 20:21:46

运行 ID: 231290

#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; }