运行 ❯
获取您
自己的
网站
×
更改朝向
更改主题,深色/浅色
转到 Spaces
#include <iostream> #include <cstdlib> // Needed for rand() and srand() #include <ctime> // Needed for time() using namespace std; int main() { // Get a different random number each time the program runs srand(time(0)); // Generate a random number between 0 and 100 int randomNum = rand() % 101; cout << randomNum; return 0; }