AT2225

· · 题解

有一种方法叫乱搞。

在 C++ 中内置了一个随机函数叫做 rand,在 Atcoder 环境下生成的数据是 0\sim 2^{31} - 1 的。所以一定要记得取模。

srand(time(0)) 是用来随机种子的,将种子设为当前的系统时间。

#include <bits/stdc++.h>

using namespace std;

signed main() {
    srand(time(0));
    for (int i = 1; i <= 100; i ++)
        cout << rand() % 1000000000 << '\n';
    return 0;
}