l13.1a
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 1A 代码 · 共 40 行
1A
40 行
#printWrite a program which readsits input and counts the number ofcharacters and the number of spaces(where a space is either a blank ora tab or a newline). Print both numbers.Compile, test, and type "ready".#once #create Refhoboken harrison newark roseville avenue grove streeteast orange brick church orange highland avenuemountain station south orange maplewood millburn short hillssummit chatham madison convent station morristownnew providence murray hill berkeley heightsgillette stirling millington lyons basking ridgebernardsville far hills peapack gladstone#usera.out <Ref >x1a.out <Ref >x2grep 348 x1 >/dev/null || grep 45 x2 >/dev/null#succeed #include <stdio.h>/* One way: */main() { int nchar, nspace; char c; nchar = nspace = 0; while ((c = getchar()) != EOF) { nchar++; if (c == ' ' || c == '\t' || c == '\n') nspace++; } printf("spaces = %d, chars = %d\n", nspace, nchar);}#log#next14.1a 1014.2a 5
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?