判断题

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

#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;

}

A 正确
B 错误
赣ICP备20007335号-2