Skip to content

Commit 25b52b4

Browse files
authored
Merge pull request #235 from kianmeng/master
Add C1 & C2 solutions for weekly #11
2 parents 30b2ecf + 49306fd commit 25b52b4

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# vi:et:sw=4 ts=4 ft=perl
2+
#!/usr/bin/env perl
3+
4+
use v5.10;
5+
use strict;
6+
use warnings;
7+
use utf8;
8+
9+
say grep { $_ == ($_ * 9 / 5) + 32 } (-100 .. 100);
10+
11+
1;
12+
13+
__END__
14+
$ perl ch-1.pl
15+
-40
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# vi:et:sw=4 ts=4 ft=perl
2+
#!/usr/bin/env perl
3+
4+
use v5.10;
5+
use strict;
6+
use warnings;
7+
use Math::MatrixReal;
8+
9+
my $n = shift;
10+
my $matrix = Math::MatrixReal->new_diag([(1) x $n]);
11+
$matrix->display_precision(0);
12+
say $matrix;
13+
14+
1;
15+
16+
__END__
17+
18+
$ perl ch-2.pl 4
19+
[ 1 0 0 0 ]
20+
[ 0 1 0 0 ]
21+
[ 0 0 1 0 ]
22+
[ 0 0 0 1 ]

0 commit comments

Comments
 (0)