Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n,nr,Min=1001,Max=0;
- cin>>n;
- for(int i=1;i<=n;++i)
- cin>>nr,Min=min(nr,Min),Max=max(nr,Max);
- cout<<Min+Max<<'\n';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment