// Does not check file existence but return a correct value with empty (size=0) files // Does count paragraphs correctly (does not count empty lines (\n\n)) int main(int argc, array(string) argv) { int count=0; object f = Stdio.FILE(argv[1]); foreach(f->line_iterator(f); int number; string paragraph) { count++; // write(number+" "+paragraph+"\n"); } write("number of paragraphs= "+count+"\n"); return 0; } |