输出【1,60】的随机数 #include <iostream> #include<ctime> //使用time(0)的头文件 #include<cstdlib> //使用rand(),srand()的头文件 using namespace std; int main() { srand(time(0)); //srand()为rand()提供中字数 int n=rand()%60+1; cout<<n<<endl; return 0; }