random number

xiaoxiao2021-03-06  62

#include

#include

#include

#include

Template

Struct Display

{

Void Operator () (const t value) {std: cout << value << '';}

}

Inline Int Random (Int min, int max)

{

Return (()% (MAX 1-min)) min);

}

int main ()

{

Typedef st :: vector Intarray;

INTARRAY MyArray;

SRAND (NULL);

For (ITN i = 0; i <10; i)

{

MyArray.push_back (Random (10, 60));

FOR_EACH (MyArray.begin (), MyArray.end (), Display ());

Return 0;

}

转载请注明原文地址:https://www.9cbs.com/read-119280.html

New Post(0)