📄 p38 exit explained.ox
字号:
#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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -