‹ 上一题 下一题 ›

g3-03572. GESP-3级-2024-06-判断-第09题 未做

1000 ms 256 MB 测试点 ? GESPGESP-32024-06判断客观题3级·枚举与模拟枚举模拟

执行下面 C++ 代码后,输出的结果不可能是 。

#include <iostream>
#include <cstdlib> // 为了使用 rand() 和 srand()
#include <ctime>   // 为了使用 time()

using namespace std;

int main() {
    // 设置随机种子
    srand(time(NULL));

    int i = 1;
    int s[5];
    while(i <= 5) {
        int a = rand() % 10;
        if(a % 3 == (i + 1) % 3)
            s[i++] = a;
    }
    for(int i = 1; i <= 5; i++)
        cout << s[i];
    cout << endl;
    return 0;
}
未选择
输入
输出

            
答案