1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| #include <iostream> #include <algorithm> using namespace std; int n; int main() { cin >> n; int x = 0, y = 0, t; while (n--) { cin >> t; x = max(x, t); } cin >> n; while (n--) { cin >> t; y = max(y, t); } cout << x << ' ' << y << endl; return 0; }
|