输出【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;
}

posted on 2016-05-28 18:12  我是蒟蒻  阅读(235)  评论(0编辑  收藏  举报

导航