Skip to content

Instantly share code, notes, and snippets.

@tomcha
tomcha / newton.pl
Created Apr 13, 2019
ニュートン法
View newton.pl
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
use DDP { deparse => 1 };
print "求めたい平方根を入力>>";
chomp(my $root_num = <STDIN>);
@tomcha
tomcha / quicqsort2.pl
Created Apr 13, 2019
クイックソートその2
View quicqsort2.pl
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
use DDP { deparse => 1 };
my @seeds;
for (1..10){
@tomcha
tomcha / quicksort.pl
Created Apr 13, 2019
クイックソート1
View quicksort.pl
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
use DDP { deparse => 1 };
my @seeds;
for (1..100){
@tomcha
tomcha / fact_recursive.pl
Created Apr 13, 2019
階乗を求める
View fact_recursive.pl
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
use DDP { deparse => 1 };
chomp(my $i = <STDIN>);
say get_fact($i);
@tomcha
tomcha / gcd_recursive.pl
Created Apr 13, 2019
最大公約数をユークリッドの互除法を使って再帰で実装する
View gcd_recursive.pl
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
use DDP { deparse => 1 };
print "整数2つを入力して下さい i,j >>";
chomp(my $input = <STDIN>);
View strings_search.pl
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
use DDP { deparse => 1 };
my $strings = 'ssddperffgggperlasdf';
my $target = 'perl';
View binary_search2.pl
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
use DDP { deparse => 1 };
my @seeds;
for (1..100){
View binary_search.pl
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
use DDP { deparse => 1 };
my @seeds;
for (1..100){
View selection_search.pl
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
use DDP { deparse => 1 };
my @seeds;
for (1..100){
View linear_search.pl
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
use DDP { deparse => 1 };
my @seeds;
for (1..100){