本题数据过弱
查看原帖
本题数据过弱
172240
kuaiCreator楼主2024/5/5 09:05
#include <bits/stdc++.h>
using namespace std;
int main() {
    int n = 0, a[100] = {0}, s = 1;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> a[i]; 
    }
    for (int i = 1; i <= n; i++) {
        s *= a[i]; 
    }
    if (s > 1000000) {
        cout << ">1000000";
    } else {
        cout << s;
    }
    return 0;
}

这数据没考虑越界int 或 long long 的问题。

2024/5/5 09:05
加载中...