运行时,程序必须根据主机的当前时间显示季节。
(计划于1月份运行)
输出:
Spring(节目于4月播出)
输出:
Summer我是密码-高尔夫。最短答案(以字节为单位)获胜。
发布于 2017-05-20 17:47:55
“¡ɗNʂ:ḲO¶Z{ṅ{Ḳ®⁵⁹¢»ŒV’:3ị“ȷ14ċ⁵¶<b_þṭ»Ḳ¤果冻没有原生日期功能,但该程序在1月、2月和3月打印Spring;在4月、5月和6月打印Summer;在7月、8月和9月打印Autumn;在10月、11月和12月打印Winter。
“¡ɗNʂ:ḲO¶Z{ṅ{Ḳ®⁵⁹¢»ŒV’:3ị“ȷ14ċ⁵¶<b_þṭ»Ḳ¤ - Main link: no arguments
“¡ɗNʂ:ḲO¶Z{ṅ{Ḳ®⁵⁹¢» - compressed string: " time.gmtime().tm_mon"
ŒV - evaluate Python code - gets the month, January=1 ... December=12 (the time module has been imported in the interpreter for the time formatting atom ŒT)
’ - decrement
:3 - integer divide by three
¤ - nilad followed by link(s) as a nilad:
“ȷ14ċ⁵¶<b_þṭ» - compressed string "Summer Autumn Winter Spring"
Ḳ - split on spaces
ị - index into (1-based)
- implicit printhttps://codegolf.stackexchange.com/questions/121796
复制相似问题