/** * Created by IntelliJ IDEA. * User: me * Date: 12.09.2006 * Time: 17:23:48 * To change this template use File | Settings | File Templates. */ import java.io.*; public class CountSpace { Reader in; if (args.length == 0) else int ch; int total; int spaces = 0; for (total = 0; (ch = in.read()) != -1; total++) { spaces++; } } }