Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- const int N = 9;
- int a[N];
- int main() {
- ios_base::sync_with_stdio(false);
- cin.tie(nullptr);
- cout.tie(nullptr);
- // freopen("/home/hamoudi/Coding/run.in", "r", stdin);
- int tt = 1;
- cin >> tt;
- while (tt--) {
- int n = 5;
- for (int i = 0; i < n; ++i) {
- cin >> a[i];
- }
- // in this problem we only need to multiply the two largest numbers in the array
- // this function will sort the array in descending order
- sort(a, a + n, greater<int>());
- // so we can easily access the two largest numbers
- cout << a[0] * a[1] << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement