rand.gml
来自「开放源码的编译器open watcom 1.6.0版的源代码」· GML 代码 · 共 36 行
GML
36 行
.func rand
#include <stdlib.h>
int rand( void );
.ixfunc2 'Random Numbers' &func
.funcend
.desc begin
The &func function computes a sequence of pseudo-random integers in
the range 0 to
.kw RAND_MAX
(32767).
The sequence can be started at different values by calling the
.kw srand
function.
.desc end
.return begin
The &func function returns a pseudo-random integer.
.return end
.see begin
.seelist rand srand
.see end
.exmp begin
#include <stdio.h>
#include <stdlib.h>
void main()
{
int i;
.exmp break
for( i=1; i < 10; ++i ) {
printf( "%d\n", rand() );
}
}
.exmp end
.class ANSI
.system
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?