home > 比較編 > C, C++, Objective-C, Java, C# > arithmetic and logic >

ForNext

Only Do What Only You Can Do

029. random integer

VBScript

JScript

Perl

PHP

Python

Ruby

PowerShell

Scala

F#

C

C++

#include <boost/random.hpp>
using namespace boost;
mt19937 rng;
uniform_int<> ui(0,RAND_MAX);
variate_generator<mt19937&, uniform_int<> > brand(rng, ui);
int i = brand()

C++Builder

VC++

C#

System.Random r = new System.Random();
int i = r.Next();




Java

java.util.Random r = new java.util.Random();
int i = r.nextInt();




Objective-C

#include <stdlib.h>

int i = rand();



D

VB

VB.NET

Delphi

Ada

PL/SQL

T-SQL

関数型

inserted by FC2 system