LGED

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
#include <iostream>
#include <stdlib.h>
#include <time.h>

#define random(a,b) (rand() % (b-a) + a)

using namespace std;

int main()
{
    srand((unsigned)time(NULL));
    for(int i=0; i<10; i++)
        cout << random(1,100) << "\t" << rand()/double(RAND_MAX) << endl;
}

 

posted on 2016-08-24 15:04  LGED  阅读(225)  评论(0编辑  收藏  举报