[ Web Proxy ]
URL:
Viewing: https://ru.cppreference.com/cpp/experimental/randint [Back]  [Original]

std::experimental::randint cppreference.com
cppreference.com

std::experimental::randint

cppreference.com
<tbody> </tbody>
template <class IntType> IntType randint(IntType a, IntType b);
( v2)

[a, b].

a, b ,

i [a, b], std::uniform_int_distribution<IntType> .

IntType short, int, long, long long, unsigned short, unsigned int, unsigned long unsigned long long, .

, a > b.

#include <iostream>
#include <experimental/random>

int main()
{
    int random_number = std::experimental::randint(100, 999);
    std::cout << " 3- : " << random_number << '\n';
}

:

 3- : 273


() []

Web Proxy Viewer  |  New URL  |  Original Page