Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include<bits/stdc++.h>
using namespace std;
int main(){
int n, m, maxx = 0, maxy = 0;
cin>>n;
int x;
for(int i = 0; i < n; i++){
cin>>x;
maxx = x > maxx ? x : maxx;
}
cin>>m;
for(int i = 0; i < m; i++){
cin>>x;
maxy = x > maxy ? x : maxy;
}
cout<<maxx<<" "<<maxy<<endl;
return 0;
}
Copy The Code &
Try With Live Editor
Input
1
20
2
10 20
20
2
10 20
Output
20 20
Demonstration
Codeforcess solution 1206-A A. Choose Two Numbers C++, Java, Js and Python,1206-A, Codeforcess solution