Untitled

mail@pastecode.io avatar
unknown
c_cpp
a year ago
262 B
1
Indexable
#include <iostream>
using namespace std;
int main()
{
    int n;
    int c;
    int d;
    int i;
    int b;
    cin >> n >> d;
    c=d;
    for (i=2; i<=n; i++)
    {
        cin >> b;
        if(b>d)d=b;
        if (b>c)c=b;
    }
    cout << c << ' ' << d;
}