Help for this page

Select Code to Download


  1. or download this
    # gen-roman.pl
    use strict;
    ...
          print "$r\n";
       }
    }
    
  2. or download this
    perl gen-roman.pl >t1.txt
    
  3. or download this
    $ perl rtoa-pgatram.pl t1.txt >pgatram.tmp
    
  4. or download this
    rtoa pgatram start
    read_input_files : 1 secs
    roman_to_arabic  : 7 secs
    output           : 0 secs
    total            : 8 secs
    
  5. or download this
    # rtoa-pgatram.pl
    # Example run: perl rtoa-pgatram.pl t1.txt >pgatram.tmp
    ...
    
    warn "output          : $taken3 secs\n";
    warn "total           : $taken secs\n";
    
  6. or download this
       push @list_ret, reduce { $a+$b-$a%$b*2 } map { $rtoa{$_} } split//,
    + uc($_);
    
  7. or download this
       use Roman;
       ...
       push @list_ret, arabic($_);
    
  8. or download this
    $ perl rtoa-roman.pl t1.txt >roman.tmp
    rtoa roman start
    ...
    output           : 1 secs
    total            : 13 secs
    $ diff roman.tmp pgatram.tmp
    
  9. or download this
    // rtoa-pgatram.cpp
    // Compile with:
    ...
    
       return 0;
    }
    
  10. or download this
    $ g++ -o rtoa-pgatram -std=c++20 -Wall -O3 rtoa-pgatram.cpp
    $ ./rtoa-pgatram t1.txt >cpp.tmp
    ...
    roman_to_dec time :    0.095 secs
    output time       :    0.247 secs
    $ diff roman.tmp cpp.tmp
    
  11. or download this
    output time       :    0.098 secs