mstsortlen.pl.in

来自「Lin-Kernighan heuristic for the TSP and 」· IN 代码 · 共 18 行

IN
18
字号
#! @PERL@# @configure_input@# mstsortlen.pl# Input is $n$ followed by $n$ floating point numbers, one to a line.# Output is the $n$ numbers, in increasing order.$tmp_file = "/tmp/mstsortlen.$$";open(TMP,"|sort -n -r >$tmp_file") # Relies on numeric sort!	|| die "Can't open $tmp_file for writing"; $num_lines = <>;while( <> ) { print TMP; }close(TMP);print $num_lines;open(TMP,"<$tmp_file")	|| die "Can't open $tmp_file for reading"; while(<TMP>) { print; }unlink($tmp_file);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?