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