ans

liujunhao 2023-12-27 20:25:15 3 返回题目

#include<bits/stdc++.h>

using namespace std;

int a[110],b[110];

int main(){

int n,m,mx1=0,mx2=0;
scanf("%d%d", &n, &m);
for(int i=1;i<=n;i++)scanf("%d", &a[i]);
for(int i=1;i<=m;i++)scanf("%d", &b[i]);
for(int i=1;i<=n;i++)mx1=max(mx1, a[i]);
for(int i=1;i<=m;i++)mx2=max(mx2, b[i]);
cout<<mx1+mx2;
return 0;

}

{{ vote && vote.total.up }}