java.io.*; java.util.*; java.text.*; wc { main(String[] args) { nl = 0, nw = 0, nc = 0; { [] buff = [4096]; inword = ; length; ((length = System.in.read(buff)) != -1) { nc += length; ( i = 0; i < length; i++) { c = ()buff[i]; (c == '\n') ++nl; (Character.isWhitespace(c)) inword = ; (inword == ) { ++nw; inword = ; } } } } (IOException e) { System.err.println(e); ; } System.out.println(Integer.toString(nl) + " " + Integer.toString(nw) + " " + Integer.toString(nc)); } }
简单的字数统计
最新推荐文章于 2024-09-09 22:10:17 发布