l14.2a
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 2A 代码 · 共 27 行
2A
27 行
#printUsing the "getnum" routine on "getnum.o", write a programthat reads a list of positive numbers and prints their sum. Stop readingnumbers when "getnum" returns a negative or zero value.Compile and test your program; then type "ready".#once #create Ref5 43 293 400 75 832 903 33#once cp %s/getnum.o .#usera.out <Ref >xxxgrep 2584 xxx >/dev/null#succeed/* Read numbers and count */main(){ int s, n; s = 0; while ((n=getnum()) > 0) s += n; printf("Sum is %d\n", s);}#log#next14.2b 515.1a 10
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?