fork download
  1. #!/usr/bin/perl
  2. $str="1"; for (1 .. shift(@ARGV)) { print($str, ", "); @a = split(//, $str); $str=""; $nd=shift(@a); while (defined($nd)) { $d=$nd; $cnt=0; while (defined($nd) && ($nd eq $d)) { $cnt++; $nd = shift(@a); } $str .= $cnt.$d; } } print($str);
Success #stdin #stdout 0.01s 5360KB
stdin
Standard input is empty
stdout
1