Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int x;
- cin>>x;
- const int Size=x;
- long long seq[Size],N1,N2;
- for(int i=0;i<Size;i++){
- cin>>seq[i];
- if(i==1){
- N1=seq[0];
- N2=seq[1];
- if(N1<N2){
- swap(N1,N2);
- }
- }
- if(i>1){
- if(seq[i]>=N1){
- N2=N1;
- N1=seq[i];
- }
- else{
- if(seq[i]>N2)
- N2=seq[i];
- }
- }
- }
- cout<<N1*N2;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement