#include <iostream>
using namespace std;

int main() {
    int n;
    cin >> n;
    float arr[n];
    for (int i = 0;i < n;i++) {
        cin >> arr[i];
    }

    int max = 0;
    for (int i = 0;i < n;i++) {
        int siuu = arr[i];
        if (i != n-1) {
            for (int j = i+1;j < n;j++) {
                siuu *= arr[j];
            }
        }
        if(siuu > max){
            max = siuu;
        }
    }
    cout << max;
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: