p38 exit explained.ox

来自「时间序列分析中著名的OxMetrics软件包」· OX 代码 · 共 24 行

OX
24
字号
#include <oxstd.h> 
#include <oxprob.h>

main()              
{
	decl x, y=0;
	for (decl i=0;i<10;++i)
	{
		ranseed(i+3);
		x=rann(1,1);
		println("x : ",x);
		if (x<0)
		{
			y-=x;
			println("y-=x : ",y);
			println("Exit here. i=",i);
			exit(0);					 //When the random number for x is negative, it computes the sum and then stops
		}
		else
			y+=x;
			println("y+=x : ",y);
	}
	println(y);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?