1.代码表现
#include<iostream>
using namespace std;
#include<ctime>//使用时间种子所需的头文件
int main()
{
srand((unsigned int)time(NULL));//时间种子,保证真随机
int a=rand()%60;//0-59
int a=rand()%61;//0-60
int a=rand()%60+40;//40-99
}
#include<iostream>
using namespace std;
#include<ctime>//使用时间种子所需的头文件
int main()
{
srand((unsigned int)time(NULL));//时间种子,保证真随机
int a=rand()%60;//0-59
int a=rand()%61;//0-60
int a=rand()%60+40;//40-99
}