From 8d090c241f25b226a6533e066e5e7e21738d70be Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Tue, 25 Dec 2018 23:28:43 +0700 Subject: Merry Chistmas or other holiday of your choice --- thinkperl6/human-seconds.p6 | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 thinkperl6/human-seconds.p6 (limited to 'thinkperl6/human-seconds.p6') diff --git a/thinkperl6/human-seconds.p6 b/thinkperl6/human-seconds.p6 new file mode 100755 index 0000000..a7b2165 --- /dev/null +++ b/thinkperl6/human-seconds.p6 @@ -0,0 +1,8 @@ +#!/usr/bin/env perl6 +# Exercise 4.1 +sub MAIN(Int $seconds=240_000) { + put 'Days: ', $seconds div 86400; + put 'Hours: ', $seconds div 3600 % 24; + put 'Minutes: ', $seconds div 60 % 60; + put 'Seconds: ', $seconds % 60 +} -- cgit 1.4.1