diff options
Diffstat (limited to 'challenge-011/andrezgz/perl5/ch-1.pl')
| -rw-r--r-- | challenge-011/andrezgz/perl5/ch-1.pl | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/challenge-011/andrezgz/perl5/ch-1.pl b/challenge-011/andrezgz/perl5/ch-1.pl new file mode 100644 index 0000000000..2671169b2b --- /dev/null +++ b/challenge-011/andrezgz/perl5/ch-1.pl @@ -0,0 +1,15 @@ +#!/usr/bin/perl + +# https://perlweeklychallenge.org/blog/perl-weekly-challenge-011/ +# Challenge #1 +# Write a script that computes the equal point in the Fahrenheit and Celsius scales, +# knowing that the freezing point of water is 32 °F and 0 °C, +# and that the boiling point of water is 212 °F and 100 °C. +# This challenge was proposed by Laurent Rosenfeld. + +use strict; +use warnings; + +my $f = 212; +while ( $f - ($f - 32) * (100-0)/(212-32) ) { $f-- }; #Simple, but effective +print $f; |
