Kernighans large earthquake problem: Difference between revisions
m
→{{header|Amazing Hopper}}
Line 345:
#include <flow.h>
#include <flow-flow.h>
#define MAX_LINE 1000
Line 350 ⟶ 351:
DEF-MAIN(argv,argc)
MSET(fd, Event )
TOK-INIT
OPEN-INPUT("datos.txt")(fd)
COND( IS-NOT-FILE-ERROR? )
TOK-SEP( " " ),
WHILE( NOT( EOF(fd) ) )
LET( Event := USING(MAX_LINE) READ-
WHEN(
WHEN( GT?( VAL(TOK-GET(Event)), 6 ) ){
PRNL(
}
}
WEND
CLOSE(fd)
Line 384 ⟶ 385:
<pre>
$ hopper fl/evento.flw
8/27/1883 Krakatoa
5/18/1980 MountStHelens
1/25/4567 EdgeCase3
$
</pre>
|