- or download this
# gen-roman.pl
use strict;
...
print "$r\n";
}
}
- or download this
perl gen-roman.pl >t1.txt
- or download this
$ perl rtoa-pgatram.pl t1.txt >pgatram.tmp
- or download this
rtoa pgatram start
read_input_files : 1 secs
roman_to_arabic : 7 secs
output : 0 secs
total : 8 secs
- 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";
- or download this
push @list_ret, reduce { $a+$b-$a%$b*2 } map { $rtoa{$_} } split//,
+ uc($_);
- or download this
use Roman;
...
push @list_ret, arabic($_);
- 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
- or download this
// rtoa-pgatram.cpp
// Compile with:
...
return 0;
}
- 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
- or download this
output time : 0.098 secs